Skip to content
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

Merged
merged 1 commit into from
Mar 13, 2018

Conversation

rifelpet
Copy link
Member

@rifelpet rifelpet commented Mar 6, 2018

Fixes #2657 and #4339

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 6, 2018
@mikesplain
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 7, 2018
@robinpercy
Copy link
Contributor

/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
Copy link
Contributor

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?

Copy link
Contributor

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.

@robinpercy
Copy link
Contributor

thanks @rifelpet I'll do some testing with this shortly.

@robinpercy
Copy link
Contributor

robinpercy commented Mar 7, 2018

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

@rifelpet rifelpet force-pushed the 2657-unset-env-vars branch from 3fcfe9f to 3687787 Compare March 8, 2018 19:14
@rifelpet
Copy link
Member Author

rifelpet commented Mar 8, 2018

@robinpercy Moved the unexport towards the top of the Makefile

@chrislovecnm
Copy link
Contributor

@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.

@chrislovecnm
Copy link
Contributor

Oh and we just merged KOPS_CLUSTER_NAME I think ...

@rifelpet rifelpet force-pushed the 2657-unset-env-vars branch from 3687787 to 1175761 Compare March 8, 2018 23:12
@@ -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
Copy link
Contributor

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.

Copy link
Member Author

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

@rifelpet rifelpet force-pushed the 2657-unset-env-vars branch from 1175761 to 4772814 Compare March 9, 2018 01:35
@robinpercy
Copy link
Contributor

Thanks @rifelpet!

@chrislovecnm were there any other variables you wanted to see in here?
/assign @chrislovecnm

Copy link
Contributor

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@chrislovecnm
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 13, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 13, 2018
@k8s-ci-robot k8s-ci-robot merged commit aa34833 into kubernetes:master Mar 13, 2018
@rifelpet rifelpet deleted the 2657-unset-env-vars branch April 25, 2020 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants