Skip to content

Conversation

@ulucinar
Copy link
Contributor

@ulucinar ulucinar commented Jan 26, 2022

Description of your changes

Fixes #
Consumes 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. Please also note that aws-controllers-k8s/code-generator#266 introduces a backwards-incompatible behavior change: The default location of the generator configuration files, if one is not specified via the command-line with the -- option, is now apis/<API Group>/generator-config.yaml.

When aws-controllers-k8s/code-generator#266 is merged, I will update the consumed code-generator version accordingly.

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

I have tried running provider-aws with a modified configuration for the Cloudfront's Distribution resource that moves it to the version v1beta1.
[contribution process]: https://git.io/fj2m9

@ulucinar ulucinar requested a review from muvaf January 26, 2022 05:35
resources:
"Distribution":
api_versions:
- name: "v1alpha1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration example for the Distribution resource. I've tested generating Distribution at v1beta1.

@muvaf
Copy link
Member

muvaf commented Jan 28, 2022

@ulucinar This probably needs a rebase to show the correct diff as #1027 is merged, which should cover most of the generated file diffs already.

@muvaf
Copy link
Member

muvaf commented Jan 28, 2022

I get the following when I run make reviewable and it seems check-diff also fails because of that:

16:41:57 [ .. ] Generating apigatewayv2 controllers and CRDs
# sigs.k8s.io/json/internal/golang/encoding/json
../pkg/pkg/mod/sigs.k8s.io/[email protected]/internal/golang/encoding/json/encode.go:1249:12: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
../pkg/pkg/mod/sigs.k8s.io/[email protected]/internal/golang/encoding/json/encode.go:1255:18: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
make[3]: *** [Makefile:129: services] Error 1
make[2]: *** [Makefile:143: services.all] Error 2
make[1]: *** [build/makelib/common.mk:418: generate] Error 2
make: *** [build/makelib/common.mk:424: reviewable] Error 2

Do you get it in your local?

- 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]>
Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ulucinar !

@ulucinar ulucinar merged commit 0898bdd into crossplane-contrib:master Jan 28, 2022
@ulucinar ulucinar deleted the unversioned-config branch January 28, 2022 16:43
@haarchri haarchri mentioned this pull request Feb 10, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants