-
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
Document CRD design for the usecase of having mandatory fields within an optional struct field in the CRD spec. #3671
Comments
Working on this /assign |
Please feel free to open a PR with you suggestion. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle-stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
What do you want to happen?
Currently, Kubebuilder docs does not capture the common scenario of having mandatory (required) fields within an optional struct field in the CRD spec.
Consider the following silly example, I want
ShippingAddress
to be an optional spec field, but if user provides aShippingAddress
then I want them to mandatorily speicifyAddressType
.Futher discussion on Slack
As it turns out, we can achieve the above requirement by changing
ShippingAddress
to a pointer type.Not so silly example
VirtualHost
is optional inHttpProxySpec
in Coutour project. ButFqdn
(a field in VirtualHost) is mandatory and should adhere to a specific regex pattern.Extra Labels
/kind documentation
The text was updated successfully, but these errors were encountered: