-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Kubebuilder docs should more clearly state the interaction between kubebuilder:validation:Required
and omitempty
#3794
Comments
Hi @jmeyers35, Thank you for raising this one. However, note that all documentation in kubebuilder is generated automatically via what is the doc in the source code of controller-tools. Therefore:
Thank you for attention. @vincepri @joelanford (could you please move this issue to controller-tools if the owner be unable to do so?) |
I'm happy to open a PR for this at some point, but I wanted to flag this in case someone can get around to it before I can. I also could've been a bit more specific - when I said "documentation", I really meant the book, which I believe is indeed in this repo. But this is probably worth noting in the generated docs as well. |
Hi @jmeyers35, That is great. I see, the info that you would like to add in the docs is:
Following some examples that I hope that help you:
Please feel free to open a PR with your suggestion on where you see that it should fit, and then we can move forward from there. Thank you for your collaboration 🥇 |
Hi @jmeyers35 After share above the info to you, do you think that it still requiring further explanation? |
Just an update, kubernetes-sigs/controller-tools#944 got merged, so now it is possible to use Do we still need to add some documentation around this to close this issue, or just update |
the latter would work for me. |
Hi @jmeyers35 and @mateusoliveira43 We need to clarify the changes in : https://book.kubebuilder.io/reference/markers.html?highlight=omitempty#difference-between--optional-and--kubebuildervalidationoptional when we bump a new release within kubernetes-sigs/controller-tools#944 c/c @sbueringer ^ |
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: