Closed ulucinar closed 4 days ago
Hi @turkenf, @mergenci, Could you please take over this? Please ping me if help is needed.
Thanks for the fix @ulucinar. It's working successfully. I've completed the PR description. Could you please review @sergenyalcin and @erhancagirici?
Description of your changes
When running the API conversion functions for multi-version CRDs, there are cases, as discussed in https://github.com/kubernetes/client-go/issues/541, where the
v1.TypeMeta
information has been dropped. This breaks non-wildcard conversion function filtering performed by the conversion webhook.I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.~How has this code been tested
Tested against
crossplane-contrib/provider-upjet-aws
resourceInstance.rds
with conversions between the versionsv1beta1
,v1beta2
, andv1beta3
. Here are the steps (Note that testing the fix requires building an image, because conversion functions won't work in a provider running outside of the cluster — unless you jump through the hoops):v1beta1
MR manifest below.kubectl get instance.v1beta2.rds.aws.upbound.io/test-upjet-pr-424-db
.name
field inv1beta1
was lost when converted to storage versionv1beta2
(field renaming conversion).kubectl get instance.v1beta2.rds.aws.upbound.io/test-upjet-pr-424-db
.name
field inv1beta1
was converted successfully todbName
inv1beta2
.Resource manifest
Note that we supply an invalid
providerConfigRef
to prevent provisioning the external resource, because we don't need the resource to test conversion functions.