Checks for successful string split on env variable
This commit is contained in:
parent
967e09a3a5
commit
6d67091c8b
@ -254,7 +254,7 @@ func newDockerContainerHandler(
|
|||||||
for _, envVar := range ctnr.Config.Env {
|
for _, envVar := range ctnr.Config.Env {
|
||||||
if envVar != "" {
|
if envVar != "" {
|
||||||
splits := strings.SplitN(envVar, "=", 2)
|
splits := strings.SplitN(envVar, "=", 2)
|
||||||
if splits[0] == exposedEnv {
|
if len(splits) == 2 && splits[0] == exposedEnv {
|
||||||
handler.envs[strings.ToLower(exposedEnv)] = splits[1]
|
handler.envs[strings.ToLower(exposedEnv)] = splits[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user