-
Notifications
You must be signed in to change notification settings - Fork 60
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
Use valid names for Finalizers #1450
Comments
guettli
changed the title
Use valid names for Annotations
Use valid names for Annotations (and Finalizers)
Aug 19, 2024
guettli
changed the title
Use valid names for Annotations (and Finalizers)
Use valid names for Finalizers (and Annotations)
Aug 20, 2024
guettli
added a commit
that referenced
this issue
Aug 20, 2024
old: foo.infrastructure.cluster.x-k8s.io new: infrastructure.cluster.x-k8s.io/foo Related: #1450
This was referenced Aug 20, 2024
guettli
changed the title
Use valid names for Finalizers (and Annotations)
Use valid names for Finalizers
Aug 21, 2024
guettli
added a commit
that referenced
this issue
Aug 22, 2024
* 🌱 Update names of finalizers. old: foo.infrastructure.cluster.x-k8s.io new: infrastructure.cluster.x-k8s.io/foo Related: #1450
Implemented via #1455 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/kind bug
What steps did you take and what happened:
While reading the CAPI issue "Our finalizers are not domain-qualified, and therefore do not conform to requirements" I realized that our Finalizers and Annotations are not valid. The linked issue is about name of finalizers, but the same applies to Annotations.
Annotations usually a domain name (representing the owner) and a name.
We used for example
Tasks (for Finalizers)
Our Finalizers are not part of the public API. We don't document the names.
Tasks (for Annotations)
Related
Kubernetes issue 119445 which introduced the warning in 1.29.
How other projects did the update:
https://github.com/vmware-tanzu/vm-operator/pull/545/files#diff-94266af62f6987e14d8bcc31454437775dc7bafb5d3bed637062867a8d5b84d7R146-R155
Official Finalizers Docs
https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#finalizers
Update Strategy
At the beginning of the Reconcile() method the code would update the old names to the new names.
I would keep that code for the next releases in caph.
Then we are able to deal with old names, even if the customer skips some versions of caph.
Rejected
We can't use that pattern:
Because our apiVersion domain is "infrastructure.cluster.x-k8s.io".
This would not reflect, that caph is responsible for the finalizer:
old --> new
"hetznercluster" is just an example. We would do that for all finalizers.
old
new
Manual Testing
Create a cluster with the old version of caph.
Dump all our resources:
Run it while the original controller is running:
❯ ./dump-our-yaml.sh > step1.yaml
Run it after the new controller was installed. Write to step2.yml
❯ ./dump-our-yaml.sh > step2.yaml
Compare
❯ diff step1.yaml step2.yaml
Have a look at step2.yaml and check all finalizers.
Test deduplication
set the finalizers to:
Save.
Edit again. Now there should be only one entry (the new string).
Test finalizer of secret
Test: Delete the cluster.
The text was updated successfully, but these errors were encountered: