-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Can not convert custom resource to the new storage api version #117148
Comments
This issue is currently awaiting triage. SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the The 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. |
/sig api-machinery |
/language en |
This is mostly: although we could improve the phrasing to help readers understand the meaning. Here's a bit of text to consider rewording:
By “upgrade procedure” I think the document means that you either:
You get to choose which approach you prefer. |
Thanks! I have created go reconciler that can change status subresource of my Custom Resource using I would like to know, is it expected behaviour of |
Given that this is a request for help, it's the wrong place, but: |
/help |
@fedebongio: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed 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. |
is the conversion from v1 to v2 round-trippable? If you take an object in v2 with all its fields set, convert it to v1 and back to v2, will it drop some fields? |
No. v2 has fields that have not analogue in v1. |
Then that's not a valid conversion. Conversions are supposed to be round-trippable. |
This issue has not been updated in over 1 year, and should be re-triaged. You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
/cc @muff1nman Thanks for jumping in :) /triage accepted |
I created my own Custom Resource Definition. Let`s call it
logging.customresource.com
. It has v1 and I created custom resourcelogging1
.I need to update this CRD and add v2 as storage version. Some of the properties changed its` names in v2 and the old names removed from this new version.
I deployed conversion webhook and configured it in
logging.customresource.com
configuration. But conversion webhook does not change and save the actual custom resourcelogging1
to the storage version. It allows only get the resource to my or other requests to this resource, as I understood.I would like to make it clear: if I want to mark v1 as deprecated and stop to support it soon, I need to make upgrade of the
logging1
.According to documentation
What are the ways to convert resource? I mean saving resource to etcd with the last storage version.
But when I try to modify it,
apiVersion=v2
was saved (I checked it in etcd), but the new properties did not apply and the old values are lost. And even iflogging1
hasapiVersion=v2
, I can not add new properties. It is just ignored without errors.In the section
Upgrade existing objects to a new stored version
in option 2 said:What does
upgrade procedure
mean?Do I need to delete
logging1
of version v1 and then recreate it with v2 or how to make work the existing custom resource but with the last api version? And maybe it is better to watch CRDlogging.customresource.com
and when storage version changed, I need to recreate custom resource (if I would like to support only v2)?Also there was a comment kubernetes/website#27534 (comment) and good question about describing what happens in different cases with or without conversion webhook, but it is not described in documentation yet unfortunately.
Documentation link: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#upgrade-existing-objects-to-a-new-stored-version
The text was updated successfully, but these errors were encountered: