-
Notifications
You must be signed in to change notification settings - Fork 451
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
Generate all Seed CRDs to example #4854
Conversation
Hmm,
However, |
fi | ||
|
||
echo "Generating CRDs for $group group" | ||
controller-gen crd paths="$package_path" output:crd:dir="$output_dir" output:stdout |
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.
What do you think about using a controller-gen
bin from a dedicated bin
directory as realized here. In the past, we had issues that different projects use different versions of contorller-gen
and also long as we don't execute these commands in a dedicated container, we can at least place them in a git-ignored directory.
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.
That's a great idea. Let's do it similarly to the yq binary, that we already install in such a way here.
I thought about doing this actually, but I didn't want to change the way controller-gen is installed in the same PR.
But now that you propose it, let's do it directly :)
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.
Done in a new commit.
In a follow-up PR, we could get rid of the $YQ
variable in start-gardenlet
(and rather use the changed PATH
):
YQ="$REPO_ROOT/hack/tools/bin/yq" |
Lines 180 to 184 in 27c2a5e
@go install -mod=vendor github.com/onsi/ginkgo/ginkgo | |
@go install -mod=vendor github.com/ahmetb/gen-crd-api-reference-docs | |
@go install -mod=vendor github.com/golang/mock/mockgen | |
@go install -mod=vendor sigs.k8s.io/controller-runtime/tools/setup-envtest | |
@go install -mod=vendor sigs.k8s.io/controller-tools/cmd/controller-gen |
a4cc6d1
to
692c828
Compare
Weird,
However, when I hijack the build container, I can run the following successfully:
This is exactly how it should look like. I'm confused again ... 🤔 EDIT: |
For the Druid I recall that we first needed to |
I think, I found the problem: In gardener/hack/generate-parallel.sh Lines 37 to 39 in 10fe751
However, we don't even call Because of
It wasn't failing on my machine before, because it just used my local clone of Long story shortI think we have to remove |
692c828
to
81a5f55
Compare
For now, I have simply dropped |
b3d7735
to
5fc3b8b
Compare
5fc3b8b
to
935b00b
Compare
Rebased, now that #4822 is merged. |
It would be good to include this in v1.34.0, given that #4851 is already merged (which will require extensions to update their CRDs, gardener/gardener-extension-provider-aws#430). With this hack script, extension can easily regenerate new versions of their CRDs without much effort. |
Hm,
Do you have the same issue? |
This seems to be related to #4570. |
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
/lgtm both |
* Generate all Seed CRDs to example * Install controller-gen to tools bin dir * Fix check-generate * Set GO111MODULE=off in the scripts where it's needed
* Generate all Seed CRDs to example * Install controller-gen to tools bin dir * Fix check-generate * Set GO111MODULE=off in the scripts where it's needed
How to categorize this PR?
/area dev-productivity
/kind enhancement
What this PR does / why we need it:
With this PR,
make generate-extensions-crds
is replaced by a reusable hack scriptgenerate-seed-crds.sh
, that can generate all of our CRDs (extensions, druid, resources) or selected groups of them usingcontroller-gen
.make generate
to generate all seed CRDs toexample/seed-crds
and the resource-manager CRDs toexample/resource-manager
.ls example/20-crd-* | xargs -I {} kubectl apply -f {}
). See timebertt/gardener-extension-provider-aws@a686de3Which issue(s) this PR fixes:
Part of gardener/gardener-extension-provider-aws#430
Special notes for your reviewer:
Currently I'm missing CRDs for
VPA
,HVPA
andDNS{Provider,Owner,Entry}
.I think, the HVPA and DNS CRDs are not strictly required as they are also not available in https://github.com/gardener/gardener-extension-provider-aws/tree/master/example.
However, there is https://github.com/gardener/gardener-extension-provider-aws/blob/master/example/20-crd-vpa.yaml but I'm not sure how we can generate it and if it's actually needed.
Any input is appreciated!
Release note:
A new hack script `generate-seed-crds.sh` was added, that can generate all of Gardener's Seed CRDs using `controller-gen`. See [this file](https://github.com/gardener/gardener/blob/master/example/seed-crds/doc.go) for an example usage. Make sure to add `controller-gen` to the list of requirements and `example` to the list of generated paths.