What steps did you take and what happened:
What did you expect to happen:
Anything else you would like to add:
I checked with sig-apimachinery and conversion cannot fail because an older api version doesn't have the same fields as a newer one. In Convert_v1alpha3_KubeadmConfigStatus_To_v1alpha2_KubeadmConfigStatus, we're returning an error if the a3 version has status.dataSecretName. We can choose from:
Option 1 is probably a nonstarter because it would mean we'd lose data if we did a3 -> a2 -> update apiserver.
Environment:
/kind bug
@vincepri
/assign
CC @detiber given that failing conversion was suggested during review. I don鈥檛 have enough experience with conversions, I am ok with whatever is correct
Slack conversation w/Jordan: https://kubernetes.slack.com/archives/C0EG7JC6T/p1576874571057600
"conversion is not allowed to fail for reasons like that"
My suggestion for failing downconversion was specifically because we weren't tackling the problem of preserving the data on downconversion...
Will we hit any issues with Option 2 if someone is using an old version of v1alpha2 APIs vendored into a client application?
Will we hit any issues with Option 2 if someone is using an old version of v1alpha2 APIs vendored into a client application?
If they do an update instead of a patch, yes. That's why we've been pushing patch so heavily. Sounds like the annotation approach is the safest?
If they do an update instead of a patch, yes. That's why we've been pushing patch so heavily. Sounds like the annotation approach is the safest?
I did a quick bit of prototyping a while back to prove out the idea, and it was relatively simple to implement, just had to implement it in either the ConvertFrom methods, or in the Convert_v1alpha3_<Type>_To_v1alpha2_Type> methods, since the Spec/Status conversion methods don't have access to the annotations.
Seems like an annotation on the v1a2 types is the way to go?
Yes
on it
/lifecycle active
Any preferences regarding the annotation name?
<type>.cluster.x-k8s.io/compat-<fieldpath1>.<fieldpath2>...?
I was more leaning towards marshaling the entire object and avoid any dynamic annotation, wdyt?
@vincepri wouldn't that introduce complications on how to properly merge the resources during a later conversion?
What do you mean? We wouldn't just unmarshal the entire object in the destination, we'll use the information saved to convert only fields that need this kind of manual conversion.
This is fixed.
/close
@ncdc: Closing this issue.
In response to this:
This is fixed.
/close
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.