Skip to content

Commit

Permalink
Merge pull request #34 from Crazybus/ssh_itsa_secret
Browse files Browse the repository at this point in the history
Don't add the value for the environment variable to the run command
  • Loading branch information
Crazybus authored Nov 24, 2018
2 parents 2fb0818 + 66d668e commit ced1a55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lope.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (l *lope) addEnvVars() {
}
}
if add && !blacklisted {
l.params = append(l.params, "-e", e)
l.params = append(l.params, "-e", name)
}
}
if l.cfg.ssh {
Expand Down Expand Up @@ -389,7 +389,7 @@ func (l *lope) commandProxy() {

l.params = append(l.params, "--add-host=localhost:"+ip)

l.envs = append(l.envs, "LOPE_PROXY_ADDR=http://"+ip+":"+l.cfg.cmdProxyPort)
l.params = append(l.params, "-e", "LOPE_PROXY_ADDR=http://"+ip+":"+l.cfg.cmdProxyPort)
}

func debug(message string) {
Expand Down
10 changes: 5 additions & 5 deletions lope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ func TestAddEnvVars(t *testing.T) {
[]string{},
[]string{},
false,
"-e ENV1=hello1",
"-e ENV1",
},
{
"Add multiple env vars",
[]string{"ENV1=hello1", "ENV2=hello2"},
[]string{},
[]string{},
false,
"-e ENV1=hello1 -e ENV2=hello2",
"-e ENV1 -e ENV2",
},
{
"Blacklist an env var",
Expand All @@ -219,15 +219,15 @@ func TestAddEnvVars(t *testing.T) {
[]string{},
[]string{"ENV"},
false,
"-e ENV1=hello1 -e ENV2=hello2",
"-e ENV1 -e ENV2",
},
{
"Blacklist and whitelisting env vars",
[]string{"ENV1=hello1", "ENV2=hello2", "NO=no"},
[]string{"ENV1"},
[]string{"ENV"},
false,
"-e ENV2=hello2",
"-e ENV2",
},
{
"Add the SSH auth socket if ssh is enabled",
Expand Down Expand Up @@ -532,7 +532,7 @@ func TestCommandProxy(t *testing.T) {

got := ""
want := test.want
for _, e := range l.envs {
for _, e := range l.params {
split := strings.Split(e, "=")
if split[0] == "LOPE_PROXY_ADDR" {
addr, err := url.Parse(split[1])
Expand Down

0 comments on commit ced1a55

Please sign in to comment.