From bd496460a09429beb4b2b870f55ea8407cee49b8 Mon Sep 17 00:00:00 2001 From: Jeremy Alvis Date: Wed, 28 Oct 2020 08:55:43 -0600 Subject: [PATCH] Only remove BOSH_ALL_PROXY and CREDHUB_PROXY when their specific vars are set or no vars are set --- commands/bosh_environment.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/bosh_environment.go b/commands/bosh_environment.go index d426e5500..47f7bf9a2 100644 --- a/commands/bosh_environment.go +++ b/commands/bosh_environment.go @@ -92,10 +92,7 @@ func (be BoshEnvironment) Execute(args []string) error { } variables := make(map[string]string) - unsetVariables := []string{ - "BOSH_ALL_PROXY", - "CREDHUB_PROXY", - } + var unsetVariables []string allEnvVars := !be.Options.BoshVars && !be.Options.CredhubVars @@ -110,6 +107,7 @@ func (be BoshEnvironment) Execute(args []string) error { "BOSH_CLIENT_SECRET", "BOSH_ENVIRONMENT", "BOSH_CA_CERT", + "BOSH_ALL_PROXY", }...) } @@ -124,6 +122,7 @@ func (be BoshEnvironment) Execute(args []string) error { "CREDHUB_SECRET", "CREDHUB_SERVER", "CREDHUB_CA_CERT", + "CREDHUB_PROXY", }...) }