Skip to content

Commit

Permalink
Merge pull request #275 from pablochacin/master
Browse files Browse the repository at this point in the history
Pass PROXY environment variables to nodes
  • Loading branch information
BenTheElder authored Feb 9, 2019
2 parents 9334b03 + 9e758e2 commit a57ad6e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/cluster/nodes/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package nodes
import (
"fmt"
"net"
"os"

"github.com/pkg/errors"
"sigs.k8s.io/kind/pkg/cluster/config"
Expand Down Expand Up @@ -130,6 +131,16 @@ func createNode(name, image, clusterLabel string, role config.NodeRole, extraArg
"--entrypoint=/usr/local/bin/entrypoint",
}

// pass proxy environment variables to be used by node's docker deamon
httpProxy := os.Getenv("HTTP_PROXY")
if httpProxy != "" {
runArgs = append(runArgs, "-e", "HTTP_PROXY="+httpProxy)
}
httpsProxy := os.Getenv("HTTPS_PROXY")
if httpsProxy != "" {
runArgs = append(runArgs, "-e", "HTTPS_PROXY="+httpsProxy)
}

// adds node specific args
runArgs = append(runArgs, extraArgs...)

Expand Down

0 comments on commit a57ad6e

Please sign in to comment.