-
Notifications
You must be signed in to change notification settings - Fork 226
Make CRD version configurable #266
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
Conversation
- Fixes #1089 - Adds config.ResourceConfig.APIVersion to be able to override the generated version for a CRD Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Hi @ulucinar. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
Looks like this change is only impacting |
Hi @a-hilaly, |
@a-hilaly: The
Use 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. |
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! left one nit comment
) | ||
|
||
metaVars := m.MetaVars() | ||
detectedCRDVersions := make(map[string]struct{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/struct{}
/bool
/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved. Thank you.
/test s3-controller-test |
- Allow multiple CRD versions to be configured for the generated CRDs Signed-off-by: Alper Rifat Ulucinar <[email protected]>
@muvaf, as detailed in the description of this PR, we will need to move |
- Consume aws-controllers-k8s/code-generator#266 that implements support for specifying API versions of the generated CRDs. - Move generator-config.yaml files to unversioned API group parent folders, because an API Group may now contain multiple versions. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
/test all |
- Consume aws-controllers-k8s/code-generator#266 that implements support for specifying API versions of the generated CRDs. - Move generator-config.yaml files to unversioned API group parent folders, because an API Group may now contain multiple versions. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
- Till aws-controllers-k8s/code-generator#266 is merged. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, ulucinar, vijtrip2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thank you @a-hilaly, very much appreciated! |
- Consume aws-controllers-k8s/code-generator#266 that implements support for specifying API versions of the generated CRDs. - Move generator-config.yaml files to unversioned API group parent folders, because an API Group may now contain multiple versions. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
- Consume aws-controllers-k8s/code-generator#266 that implements support for specifying API versions of the generated CRDs. - Move generator-config.yaml files to unversioned API group parent folders, because an API Group may now contain multiple versions. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
- Consume aws-controllers-k8s/code-generator#266 that implements support for specifying API versions of the generated CRDs. - Move generator-config.yaml files to unversioned API group parent folders, because an API Group may now contain multiple versions. Signed-off-by: Alper Rifat Ulucinar <[email protected]>
override the generated version for a CRD
Issue #, if available: #1089
Description of changes:
This PR proposes a new configuration field named
APIVersion
(JSON-serialized nameapi_version
) inconfig.ResourceConfig
that allows overriding versions of specific CRDs generated by the Crossplane codegen pipeline. If a specific version string is not configured for a CRD-type, the default version specified with the--version
command-line argument is used for backwards-compatibility. An example configuration overriding the version for the CloudFront Distribution resource is as follows:This PR now introduces a backward-incompatible behavior change in the Crossplane pipeline:
Because the generator configuration is per API group (service) and because we may now have resources belonging to different API versions in a single group, this PR changes the default path of the
generator-config.yaml
file from:apis/<API group>/<API version>/generator-config.yaml
to
apis/<API group>/generator-config.yaml
An example invocation
ack-generate crossplane cloudfront --output <output path> --generator-config-path generator-config.yaml
using the above configuration yields the following file structure:Without the
resources
configuration block, all resources are underv1alpha1
version as expected:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.