k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.11k stars 353 forks source link

Remove package-wide kubebuilder:validation:optional annotation #4674

Open twz123 opened 5 days ago

twz123 commented 5 days ago

Description

Kubebuilder will deduce the optional attribute from the JSON annotations, if unspecified. Add all the missing omitempty JSON annotations for truly optional fields, which is the right choice in 99% of the cases anyway. Also add some missing default annotations along the way.

Overall, this brings the CRDs more in sync to what k0s actually expects at runtime, while omitting the rendering of useless zero values in JSON/ YAML representations.

Convert the config in k0s config create to unstructured to be able to tweak the actual YAML. Remove the creationTimestamp from the output. Remove all the parts from the docs that don't show up in reality.

See:

Type of change

How Has This Been Tested?

Checklist: