-
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
Handle deprecated fields during conversion from v1beta1 to v1 #4546
Comments
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/lifecycle frozen |
Should this be folded into #4983? |
probably 🙃 |
Added it to the linked issues in that epic! I think this still has value remaining open as a subtask, to discuss what we want to do when we update the stored version to v1 and need to implement conversion from v1beta1 to v1. |
@afrittoli if you have any context about past pitfalls we ran into when supporting deprecated fields on conversion from v1alpha1 -> v1beta1 this issue is probably the best place for it! |
Note that this can happen no matter what we do 🙃. If the user / tool cleans the annotation(s), the situation is the same 👼🏼 |
This issue is for discussing how to implement conversion between v1beta1 and v1 CRDs, as proposed in TEP-0096. This conversation came up in tektoncd/community#587.
One question we will need to answer is how to handle the "resources" field of Task/TaskRun/Pipeline/PipelineRun, since these will be removed in v1.
Copying over a comment from @sbwsg:
We serialize the Finally section of a v1beta1 Pipeline into an annotation if a client requests the v1alpha1 version. When a client submits a v1alpha1 version of a Pipeline with that annotation present the process reverses and the v1beta1 object is recreated with the Finally section in-tact:
pipeline/pkg/apis/pipeline/v1alpha1/pipeline_conversion.go
Lines 142 to 177 in 7a0a988
We don't do this for any other v1beta1-only fields. So, for example, when a v1alpha1 client requests a v1beta1 Pipeline with When Expressions, we simply drop them on the floor. If that client then re-applies the v1alpha1 version the stored v1beta1 version will be updated and the when expressions will be gone.
For a while we were working on an approach where we take the entire v1beta1 object and serialize it into an annotation when clients request v1alpha1, but it proved to be a complex and imperfect workaround.
The text was updated successfully, but these errors were encountered: