1
0
mirror of https://github.com/rancher/os.git synced 2025-09-03 07:44:21 +00:00

Remove empty Docker engine arguments

This commit is contained in:
Josh Curl
2016-11-21 15:18:44 -08:00
parent 4d9b2595b8
commit 1d617f1b92
2 changed files with 20 additions and 2 deletions

View File

@@ -43,11 +43,15 @@ func generateEngineOptsSlice(opts EngineOpts) []string {
}
case []string:
for _, elem := range value {
optsSlice = append(optsSlice, fmt.Sprintf("--%s", optTag), elem)
if elem != "" {
optsSlice = append(optsSlice, fmt.Sprintf("--%s", optTag), elem)
}
}
case map[string]string:
for k, v := range value {
optsSlice = append(optsSlice, fmt.Sprintf("--%s", optTag), fmt.Sprintf("%s=%s", k, v))
if v != "" {
optsSlice = append(optsSlice, fmt.Sprintf("--%s", optTag), fmt.Sprintf("%s=%s", k, v))
}
}
}
}