fix: correctly split flags
This commit is contained in:
@@ -105,18 +105,18 @@ func GetSpecifiedDockerOptionsForPhase(appName string, phase string, desiredOpti
|
||||
break
|
||||
}
|
||||
|
||||
parts := strings.SplitN(option, " ", 2)
|
||||
if len(parts) != 2 {
|
||||
common.LogWarn(fmt.Sprintf("Invalid docker option found for %s: %s", appName, option))
|
||||
continue
|
||||
}
|
||||
|
||||
// match options that are in the format "--option=value"
|
||||
if strings.HasPrefix(option, fmt.Sprintf("%s=", desiredOption)) {
|
||||
if _, ok := foundOptions[desiredOption]; !ok {
|
||||
foundOptions[desiredOption] = []string{}
|
||||
}
|
||||
|
||||
parts := strings.SplitN(option, "=", 2)
|
||||
if len(parts) != 2 {
|
||||
common.LogWarn(fmt.Sprintf("Invalid docker option found for %s: %s", appName, option))
|
||||
continue
|
||||
}
|
||||
|
||||
foundOptions[desiredOption] = append(foundOptions[desiredOption], parts[1])
|
||||
break
|
||||
}
|
||||
@@ -127,6 +127,12 @@ func GetSpecifiedDockerOptionsForPhase(appName string, phase string, desiredOpti
|
||||
foundOptions[desiredOption] = []string{}
|
||||
}
|
||||
|
||||
parts := strings.SplitN(option, " ", 2)
|
||||
if len(parts) != 2 {
|
||||
common.LogWarn(fmt.Sprintf("Invalid docker option found for %s: %s", appName, option))
|
||||
continue
|
||||
}
|
||||
|
||||
foundOptions[desiredOption] = append(foundOptions[desiredOption], parts[1])
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user