-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Change default path from /usr/local/kubebuilder/bin/ to something that doesn't require SUDO #1732
Comments
The default value is set up in the controller-runtime, however, the PR: #1711 will address that since the bins will be download per project. |
I'm not sure what you mean by bins will be downloaded per project. Do you mean gobin? |
HI @ellistarn, To change the default path we raised an issue in the controller-runtime to address it. See: kubernetes-sigs/controller-runtime#1234. However, for v3+ plugin on the master, you can see that test target will download the bins in the project. Then, see that we ave been working on in a better solution in the PR: #1711 You can also, customize your project to work as was done in this PR until it in the introduced in the project. |
Thank you! Just so I'm tracking this correctly. After PR #1711, the binaries will be provided in GOBIN? |
HI @ellistarn, The #1711 proposes a solution where the env test binaries are downloaded in the In this way, IMO we need to change the default to be So, after both be addressed we will end up with the following behaviour:
Is it make sense? |
Yeah makes sense thank you. When does the download to /bin happen? Is it on testenv setup, or on project creation? I'm not super excited about checking the binaries in to /bin or adding /bin to my gitignore, so I definitely prefer the GOBIN solution. I'll take a look at what it might take to do this. |
Hi @ellistarn, Users still not needing care about it at all. All complexities are abstracted by the tool.
It happens when the Makefile target test is called
It is done by default already. The projects that are scaffolded by the tool has a .gitigore which is set up to ignore all that by default should not be commited. |
Yeah I understand it's automatically scaffolded, but I think this still prevents a problem. As a Kubebuilder user, one of the first things I did was remove a bunch of what I thought of as "kubebuilder cruft" from my project. These were things I thought were unnecessary or messy or confusing. For example I completely rewrote the makefile to rely on http://github.com/google/ko for a more streamlined build/deploy story. I also manage my dependencies (ginkgo, gomega, golanglint-ci) via a go module in tools/go.mod. I also completely rewrote the /config section as I disagreed with the organization. The point of this isn't to say that kubebuilder should do all these things, but as an example of how and why users will diverge. I think Kubebuilder is an amazing starting point, but the team should be expecting their users to diverge pretty quickly to what makes the most sense for the user's development style and use case. In this sense, keeping opinions as optional as possible should be a goal. |
In the case here, I'm quite excited by having kubebuilder vend its test binaries via GOBIN because that's how all my tools vend their binaries to my CI system
This simple command installs my entire CI workflow onto a fresh VM. Presently, I need to do a hack for kubebuilder (which requires sudo)
|
Hi @ellistarn, To solve your problem so far, note that you can set the env var
See the example; https://github.com/operator-framework/operator-sdk/blob/6e5f58b07e26658bbcf34b9d467b91622b43e0c0/testdata/go/memcached-operator/controllers/suite_test.go |
For the next release and go version plugin it will no longer be required use sudo permissions because the makefile target test will download the bins inside of the project. So, we can consider it as done. However, it still not the ultimate solution desired and then, see that we have already tracked in controller-runtime an issue to change the default path for GOPATH/bin as suggested here. However, this change requires to get done there. More info: kubernetes-sigs/controller-runtime#1234 In this way, I am closing this one. |
It would be great if kubebuilder didn't require sudo to install (on most machines). /usr/local is typically a restricted area of the filesystem. Additionally, it doesn't automatically wire up commonly added PATH locations, so it must be individually added.
This may not be the best approach, but many tools use GOBIN which works very well for me.
I haven't found it
Nope
/kind feature
/kind documentation
The text was updated successfully, but these errors were encountered: