-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use internal versions of Tekton CRDs in reconcilers #5504
Comments
@dibyom has written up a proposal for a new API versioning strategy: https://docs.google.com/document/d/15vD5vbK5UKCDFMoOqOwEc_NYACthtCZJlTJiiEEoljY |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Looking at the scheduler-plugins repo, they've found a way to register "internal versions" of the types their controller operates on (example: https://github.com/kubernetes-sigs/scheduler-plugins/blob/7da686c01cf3bc5d8fe852334698468e046bb000/apis/config/register.go#L26), and then all the versioned types are automatically converted into the unversioned internal type. @dibyom I know you originally suggested something like this and it seems like it's actually possible which is very cool! We'd have to change our storage version over to this "unversioned" type, but once we do this, I would guess we wouldn't have to do it again (e.g. if we want to create a v2 api). @tektoncd/core-maintainers thoughts on this? FYI @JeromeJu |
If this is possible with knative/pkg without too much trouble then I'd vote yes. It would tremendously simplify the conversions between versions (and also allow us to prototype much faster with new experimental apiVersions!) |
Looks very cool indeed! thanks @lbernick 🆒
could we elaborate how this is going to be simplify workload for conversion? or are we referring to the future work of implementing the. conversions? since this felt to me a shift of the storage version that's been converting to another question in mind is how are CRDs/ features deprecated yet not-removed shall be handled ie. ClusterTask? would it be an implicit requiring this to happen after those being removed? |
My guess is we will probably have the "internal" type be the same as the v1 types we've defined, and reuse the existing conversion functions we have (although we might just need to update their signatures).
We might be able to do this independently for each CRD (not sure). For ClusterTask, we can probably just leave that in v1beta1 since we won't be adding new versions. We might have to experiment a bit to see how this will work; I could be wrong about these points. |
Super nice, but quick note on this. Because this would be the storage version, we would to have to be very careful about the change we do in there 👼🏼, and this might lead to a "relatively" big object (go struct I mean) because we are bringing with us a lot of "deprecated" fields that are there for "backward compatibilities". But I do agree, we need to experiment a bit with it 👼🏼
Yes, we can definitely do this on a CRD basis. |
yeah we definitely need to experiment to see the viability of the is approach before deciding if we can actually do this. |
I decided to look into how k8s handles these problems in a bit more detail. They have a small number of served versions of the API, and the storage version is the latest stable version. They have an internal version of their API, which is not serialized, that their code operates on. Defaulting is done when a versioned CRD is created or updated, but validation is done on the internal version of the API rather than the versioned versions. Conversion code is mostly autogenerated. If they need to add a new unstable feature, they backport it to the stored version as well, aka the latest stable version, gating it behind the feature flag. This is so that objects can successfully round-trip between API versions. They have done round-tripping in the past via annotations, the way we do currently, but found it to be too error-prone (slack convo), so they decided to add the unstable fields to stable apis instead. They tombstone fields but never remove them. I asked why they don't make the internal version the storage version, and the answer is that this is strictly more work than what they do currently, and is just another version to handle (since the latest stable version contains all the fields anyway). Here's what I think we should do:
Optional follow-ups:
|
Awesome! Out of curiosity, what does the |
@dibyom |
But the aren't the clients/informers used in the reconciler also considered "clients" or users? How does the reconciler get to fetch/update/watch for changes but not other clients? |
/assign |
Hi @tektoncd/core-maintainers, I want to update our proposal of approaching this issue:
For more details and alternative discussions, please take a look at this doc |
@Yongxuanzhang essentially, the proposal is to
Am I right ? |
Yes. That's right, but I think we don't do defaulting for internal version. |
Alright, I think it could be nice (we need to validate it works well) 👍🏼. |
Hi @tektoncd/catalog-maintainers, @tektoncd/catlin-collaborators. Just want to raise your attention and see if there are any concerns regarding the internal version proposal?
I will document all of the impacts into developer doc when implementing this feature. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/lifecycle frozen |
Currently, we use the "enable-api-fields" feature flag to allow users to opt into features at different stability levels, as described in tep-0033.
We have discussed moving towards maintaining multiple versions of CRDs in the future (for example, a v1 version with stable features and a v2alpha1 version with stable and alpha features), but the main reason we don't do this is because it creates a large maintenance burden for contributors.
This issue can be used to brainstorm ways to make it easier to maintain multiple API versions of our CRDs.
Some ideas that have already come up:
The text was updated successfully, but these errors were encountered: