-
Notifications
You must be signed in to change notification settings - Fork 417
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:validation:Required marker not working #599
Comments
Update: The I am not able to recall if docs(https://book.kubebuilder.io) mentions it, but I hope it does. With that I mark this issue to be closed. |
Since `omitempty` in `json` tag has presedence over kubebuilder's Required marker, we need to preserve the source's `json` tag. kubernetes-sigs/controller-tools#599 Signed-off-by: Sunghoon Kang <[email protected]>
What happened
On using +kubebuilder:validation:Required marker on fields(or packages both) does not adds that field to
required
list in the generated crd output.Example:
output crd:
What you expected to happen:
According to reference documentation
foo
field in above crd should be a required field as shown bellow:Environment:
Controller-gen version: v0.4.1
Kubernetes version: Server Version: v1.21.4
The text was updated successfully, but these errors were encountered: