-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Unset certain environment variables before testing #4595
Conversation
/ok-to-test |
/assign |
Makefile
Outdated
@@ -210,6 +210,7 @@ hooks: # Install Git hooks | |||
cp hack/pre-commit.sh .git/hooks/pre-commit | |||
|
|||
.PHONY: test | |||
unexport PROTOKUBE_IMAGE NODEUP_URL KOPS_BASE_URL DNSCONTROLLER_IMAGE KOPS_RUN_OBSOLETE_VERSION ENV_VAR_CNI_VERSION_URL AWS_REGION AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_PROFILE |
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's the scope of unexport here? Will it only apply to the test
recipe, or every recipe below it as well?
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.
@rifelpet it appears that unexport has global scope, so we should put it at the top of the file for clarity.
thanks @rifelpet I'll do some testing with this shortly. |
Unexport causes all make targets to ignore the specified environment variables. I don't think any of those included in this PR are needed at build time. But would like a second pair of eyes from @chrislovecnm or @justinsb |
3fcfe9f
to
3687787
Compare
@robinpercy Moved the unexport towards the top of the Makefile |
@robinpercy I think we want to unexport all those variables and I think more. As long as make is not crazy and unsets the variable in my current shell environment, I think we are good. @rifelpet did you get all those pesky variables? If I can read today, which is often debatable, I think we are missing STATE_STORE. Another issue is to document all these pesky rabbits, aka ENV VARs. |
Oh and we just merged KOPS_CLUSTER_NAME I think ... |
3687787
to
1175761
Compare
@@ -45,6 +45,11 @@ API_OPTIONS?= | |||
# See http://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile | |||
MAKEDIR:=$(strip $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))")) | |||
|
|||
# Unexport environment variables that can affect tests and are not used in builds |
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.
@rifelpet Nit: could we sort these in alphabetical order? It will make future management of the list less error-prone.
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.
Yeah, I have them categorized by kops-specific, aws-specific, and other cloud providers, but ill switch it to entirely alphabetical
1175761
to
4772814
Compare
Thanks @rifelpet! @chrislovecnm were there any other variables you wanted to see in here? |
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.
awesome
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrislovecnm, rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #2657 and #4339