kubernetes-sigs / kubernetes-sigs/cluster-api
Improve validation in Cluster.spec.topology
- Dominant language
- Go
- Stars
- 4.3k
- Forks
- 1.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 113
Description
### What would you like to be added (User Story)?
I think it would be good if we can go over Cluster.spec.topology and check if we have validation for all fields where it is appropriate.
Some examples:
* MachineHealthCheckTopology: we should have validation that if enable is set to false no MachineHealthCheckClass fields should be set
* MachineDeploymentStrategy: fields from MachineRollingUpdateDeployment should only be allowed to be set if Type is RollingUpdate
* The same check is missing in the MD webhook
We should in general check if there is any validation that we either have only in Cluster.spec.topology or the corresponding webhook of the core type (MD/MHC) and make sure they are sync.
This way we can avoid that the Cluster topology controller is creating MD/MHC objects which are already invalid based on their webhook
### Detailed Description
-
### Anything else you would like to add?
_No response_
### 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.
Contributor guide
Research direction
Start with Cluster.spec.topology validation for MachineHealthCheckTopology and MachineDeploymentStrategy, then compare it with the corresponding MD and MHC webhook validation. Check the conditional fields described in the issue and ensure topology-created MD/MHC objects satisfy the same rules; done means the validations are consistent across these entry points.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100