-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prevent removal of apiVersions while they are still used #8566
Comments
/triage accepted |
One clarification - how does this relate to
From #8038 |
Hm totally independent. The point from #8038 is only that clusterctl should correctly fail the CRD update if we jump from a version which doesn't have v1beta1 to a version which drops v1alpha3 (basically because that's not a valid CRD update in general) |
This is a nice check to have, but it comes with a couple of problems to be addressed, top of mind:
For 1, it seems to me that the simplest way forward is to rely on clusterctl, because it already has all the discovery logic that is required for performing such a check (I'm assuming the discovery logic that exists in clusterctl move can be re-used for this task). For 2, we can start thinking of a solution that focuses on references existing in core CAPI types, so we cover 90% of the issue. Then, in a follow-up iteration, we can extend this for references existing in provider types. /help |
@fabriziopandini: 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. |
|
So a validating webhook for |
Pretty much. I think we don't have to filter early by group. We can just take the group+ kind etc and check if it occurs in a ClusterClass This way we can also support CRDs in other groups. Afaik there is no contract that a provider has to use one of those groups |
You are right! Being in those groups is not part of the contract (https://cluster-api.sigs.k8s.io/developer/providers/cluster-infrastructure.html#cluster-api-controllers). We will just have to run it for all CRDs. |
I think that's okay. It's just important that we use This will make the whole thing a bit best-effort but I think that's acceptable. |
Is this issue up for grab? I would like to work on it if not started. |
I think you can feel free to assign yourself - thanks for taking a look at this! |
/assign |
/lifecycle active |
@Ankitasw have you been able to make progress on this? |
@killianmuldoon couldn't start with this, I might not have bandwidth as well, I can unassign it for now and come back if it's still unpicked. /unassign |
/assign Hopefully I'll get around to this - but if anyone else wants to please feel free to pick it up. Mostly assigning myself to keep track of this one as part of #8038 |
/unassign We should really try to get some solution on this as we move towards removing v1alpha4. @Ankitasw in case you have more bandwidth now. |
/priority important-longterm |
What would you like to be added (User Story)?
As a user it would be nice if Cluster API would block removal of apiVersions of CRDs as long as they are still used.
Detailed Description
Today it is possible that during a Cluster API upgrade (e.g. when bumping an infra provider) an apiVersion is removed. If this apiVersion was still referenced in other resources, they won't reconcile anymore.
Affected resources:
A possible solution is to implement a webhook which validates CRD updates. In this webhook we could check if the update on the CRD removes an apiVersion which is still referenced in relevant resources (at least ClusterClass).
Note: This webhook should probably have failurePolicy: Ignore to avoid deadlocks if Cluster API is not working for some reason.
Anything else you would like to add?
Somewhat related: #6539 (as it might lead to us dropping apiVersion from all our refs except the ones in ClusterClass)
Label(s) to be applied
/kind feature
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.
The text was updated successfully, but these errors were encountered: