-
Notifications
You must be signed in to change notification settings - Fork 166
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
Download and use controller-gen and envtest locally #369
Download and use controller-gen and envtest locally #369
Conversation
I used a different approach in kustomize-controller where envtest is not used from the shared dir. I would like to get this in all Flux controllers, please see https://github.com/fluxcd/kustomize-controller/blob/main/Makefile |
@stefanprodan thank you for the feedback! |
@stefanprodan I modified the PR following your comment. However, there are some differences from the Makefile you linked, the main ones being that both What are your thoughts on the proposed changes? |
@cebernardi this looks great, please squash all commits into a single one. |
925dc84
to
bd4017d
Compare
@stefanprodan please ignore my last commit, it's a rebase fail :( |
6379ca4
to
79dcd22
Compare
@stefanprodan all the commits are now squashed |
This fails for me on Apple Silicon and Go 1.17:
@hiddeco can you please try this on your Intel machine? |
Ok I got this running:
I'll suggest changes. |
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.
Please pin envtest to AMD64
should I squash again? |
Yes please squash |
I would maybe still make it a configurable flag to ease the first time usage if ARM64 ever becomes available.. E.g. |
7b590b6
to
fb8f738
Compare
* controller-gen and envtest are downloaded to a `bin` folder, local to the project, and used from there * envtest assets are installed in a `testbin` folder, local to the project, and used from there Signed-off-by: Cecilia Bernardi <cbernardi@expediagroup.com>
fb8f738
to
1d03726
Compare
done |
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.
This all looks good to me, and a very much welcomed improvement. Thanks a lot @cebernardi
🙇 🥇
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
Thanks @cebernardi
If we download the project in a local environment with no
kubebuilder
andkubebuilder-tools
, or with an outdated version ofcontroller-gen
, executingmake test
will fail (see also this comment).This PR copies the approach of latest version of
kubebuilder
, downloading the executables in a local directory and consuming them from there.(since apparently there's no release for envtest, I had to use
latest
)Signed-off-by: Cecilia Bernardi cbernardi@expediagroup.com