Merge pull request #2014 from alexeldeib/ace/varName

fix empty var names + clean up cross platform tests
This commit is contained in:
Kubernetes Prow Robot
2020-01-02 07:39:40 -08:00
committed by GitHub
4 changed files with 84 additions and 57 deletions

View File

@@ -130,7 +130,11 @@ func (c *ContainerFilter) getArgs() []string {
// export the local environment vars to the container
for _, pair := range os.Environ() {
args = append(args, "-e", strings.Split(pair, "=")[0])
tokens := strings.Split(pair, "=")
if tokens[0] == "" {
continue
}
args = append(args, "-e", tokens[0])
}
return append(args, c.Image)
}

View File

@@ -131,7 +131,11 @@ metadata:
}
for _, e := range os.Environ() {
// the process env
expected = append(expected, "-e", strings.Split(e, "=")[0])
tokens := strings.Split(e, "=")
if tokens[0] == "" {
continue
}
expected = append(expected, "-e", tokens[0])
}
expected = append(expected, "example.com:version")
assert.Equal(t, expected, cmd.Args)