-
Notifications
You must be signed in to change notification settings - Fork 425
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
Empty validation field when generating CRDs with multiple versions #349
Comments
Looking at the code, the I think we process each individual groupKind as many times as there are corresponding versions, but since we then end up mutating the same CRD multiple times, its validation field becomes I tested with having 2 versions of the same resource: I have a PR with a fix almost ready. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale I think this is still an issue. #350 is pending review. #365 (comment) adds integration tests to catch this bug. |
A bug in controller-tools prevent validation to appear in the generated CRDs if trivialVersions is set and multiple versions do not share the exact same schema. See kubernetes-sigs/controller-tools#349. This commit removes the usage of `crd:trivialVersions=true`, to "manually" (through Kustomize) apply the CRD modifications so we end up with the trivialVersion scheme. That is: a single `validation` field matching the OpenAPISchema of the currently stored version (v1).
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I think there's a bug which prevents the trivial versions option to work as expected.
How to reproduce:
apis/
pkg using a kubebuilder directory structure, containing multiple versions of the same CRD, with a different spec:crd:trivialVersions=true
validation
field should be filled with the schema of the version which hasstorage: true
:https://github.com/kubernetes-sigs/controller-tools/blob/master/pkg/crd/gen.go#L98-L116
validation
field, which should not happen, I think?Unless we explicitly want to have no
validation
set when multiple versions are specified? (Which currently happens, I think, as an undesired side-effect in the code).The text was updated successfully, but these errors were encountered: