-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cmd/operator-sdk/internal: explicitly set GOROOT #2754
Conversation
If the user's GOROOT does not match the GOROOT used to build the binary, they would be required to explicitly set the GOROOT env variable to their go env GOROOT. To avoid this step for end-users we can explicitly pull the GOROOT from go env and explicitly set the GOROOT env variable. Fixes: operator-framework#2744
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.
Thanks for the contribution! This will hopefully close the book on this troublesome issue.
Just a few suggestions and we can merge it.
@@ -34,6 +35,16 @@ import ( | |||
func K8sCodegen() error { |
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.
Also, just one question, is the issue just faced with the operator-sdk generate k8s command?
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.
Good question. I tested in a failing environment (where I have release v0.16.0
and unset GOROOT
), and both the crds
and csv
generate commands work without throwing any errors.
This seems to be isolated to the k8s
generation.
Thanks for the quick turnaround on feedback on the PR! Pushed a patch commit, I was not sure if y'all prefer me to squash and update my branch, or if you handle the squash on the merge. Let me know if anything is out of place, and I'll keep note for future contributions. |
We squash on merge, so no worries. As soon as CI passes, I'll merge it in. Thanks again! |
Description of the change:
If the user's
GOROOT
does not match theGOROOT
used to build the binary, they would be required to explicitly set theGOROOT
env variable:To avoid this step for end-users we can explicitly pull the
GOROOT
fromgo env
and explicitly set theGOROOT
env variable prior to generation code executing.Motivation for the change:
Closes #2744