-
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
Add validation to nested ObjectMeta fields #8231
Comments
/triage accepted this makes a lot of sense, thanks for reporting |
@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. |
Just one clarification. This issue goes way beyond ClusterClass, as far as I can tell every usage of our ObjectMeta in Cluster API is affected. |
Makes sense. We can use the upstream helper functions for this to ensure that we apply the same rules that Kubernetes does: |
I think I should be able to help with this issue. let me give it a try. |
Goal of this issue is to add validation to our nested ObjectMeta fields.
An example:
It is possible to create this DockerMachineTemplate but the creation of the DockerMachine will fail with:
I think the problem is that we have no validation for nested ObjectMeta fields, but when those are actually used as labels/annotations when we create InfraMachine, BootstrapConfig, Machine, ... the regular Kubernetes validation is of course done.
Let's check where we have nested ObjectMeta fields and implement the same validation that Kubernetes has for labels/annotations. This way users already get validation errors when they create objects like DockerMachineTemplate, ClusterClass, Cluster, ... and not just later during reconciliation in controller logs.
/kind feature
The text was updated successfully, but these errors were encountered: