Kubebuilder docs should more clearly state the interaction between kubebuilder:validation:Required
and omitempty
#3794
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/documentation
Categorizes issue or PR as related to documentation.
What broke? What's expected?
This is purely a docs ask. I've run into the behavior noted in kubernetes-sigs/controller-tools#599 a handful of times, and I think that it can be pretty surprising. The most recent time I've hit this, it caused us to break backwards compatibility in a user's CRD when we removed an
omitempty
tag on a field. I think that the interaction between the required tag andomitempty
should be more explicitly stated in the documentation (and maybe a warning added at generation time: you probably don't actually want bothrequired
andomitempty
).Reproducing this issue
No response
KubeBuilder (CLI) Version
N/A
PROJECT version
No response
Plugin versions
No response
Other versions
No response
Extra Labels
/kind documentation
The text was updated successfully, but these errors were encountered: