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

Automatically propagate proxy environment variables to docker env #3834

Merged
merged 1 commit into from
Mar 21, 2019

Conversation

tstromberg
Copy link
Contributor

@tstromberg tstromberg commented Mar 8, 2019

Currently, our documentation recommends that users use:

minikube start \
--docker-env=HTTP_PROXY=$HTTP_PROXY \
--docker-env HTTPS_PROXY=$HTTPS_PROXY \
 --docker-env NO_PROXY=$NO_PROXY

This makes the setting of --docker-env automatic if the environment variables are set, and partially resolves #3242

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 8, 2019
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 8, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tstromberg

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 8, 2019
@tstromberg
Copy link
Contributor Author

Closing in preference to #3835 - which is admittedly a bit more advanced.

@tstromberg tstromberg closed this Mar 9, 2019
@tstromberg tstromberg reopened this Mar 9, 2019
@tstromberg
Copy link
Contributor Author

Reopening, since this is a good introductory approach.

@afbjorklund
Copy link
Collaborator

It would be nice to have something more portable as, well ?

i.e. those proxy variables are also needed for other runtimes

if !cmd.Flags().Changed("docker-env") {
for _, k := range proxyVars {
if v := os.Getenv(k); v != "" {
dockerEnv = append(dockerEnv, fmt.Sprintf("%s=%s", k, v))
Copy link
Contributor

@tejal29 tejal29 Mar 12, 2019

Choose a reason for hiding this comment

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

so, potentially user can have multiple dockerEnv variables set.
In case, users have NO_PROXY as well as "HTTPS_PROXY" set it shd error out right? or is this handled later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be nice to have something more portable as, well ?

Yes, I agree. This is an introductory PR that only solves the problem for most (99%?) of users who use the defaults. Other runtimes so far don't have a mechanism for introducing environment variables, but I suspect that #3835 should cover them nicely, which adds them to /etc/environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a user manually sets --docker-env, this PR is disabled.

NO_PROXY and HTTPS_PROXY are complimentary, and thus plumbed into the environment as expected.

Copy link
Contributor

Choose a reason for hiding this comment

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

cool.

@tstromberg tstromberg merged commit 2d4e560 into kubernetes:master Mar 21, 2019
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propagate HTTP proxy config into VM
4 participants