-
Notifications
You must be signed in to change notification settings - Fork 153
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
Remove non-essential defaults from HCO #3163
Comments
Actually the k8s API conventions are stating:
And this is also somehow expected since one of the goals of HCO is to provide an |
This makes sense. That's why I phrased it as remove non-essential defaults. |
FYI @vladikr |
@jean-edouard @acardace @xpivarc |
What happened:
Currently, HCO sets defaults to many of its spec fields, which is an anti-pattern that should be removed.
As Kubernetes documentation writes [1]:
In other words, the spec should express the desired state from the user's perspective, while the status should report the current state of the object and be updated automatically by system components.
Defaults, by definitions, are values that the user does not care about, since they are missing from the spec. The fact that HCO auto-sets spec values is an anti-pattern if not a bug. This way, it is impossible to distinguish between the desired state which the user actually cares about and the current state which needs to be auto-assigned, but in the status rather than the spec.
As a side effect, changes like done in kubevirt/kubevirt#12848 will not kick in for setups that run HCO. Instead, with the current approach, defaults need to be changed in multiple places, which leads to bugs and misconfigurations.
[1] https://kubernetes.io/docs/concepts/overview/working-with-objects/
What you expected to happen:
Spec should only contain the user's provided desired state and nothing more.
Status should report the current state of an object.
How to reproduce it (as minimally and precisely as possible):
The text was updated successfully, but these errors were encountered: