Merge pull request #5750 from dokku/5710-return-scale-error

Return an error when an invalid scale count is encountered
This commit is contained in:
josegonzalez
2023-03-18 14:10:28 -04:00
committed by GitHub

View File

@@ -394,7 +394,10 @@ func ParseScaleOutput(b []byte) (map[string]int, error) {
scale := make(map[string]int)
for _, line := range strings.Split(string(b), "\n") {
s := strings.Split(line, "=")
s := strings.SplitN(line, "=", 2)
if len(s) != 2 {
return scale, fmt.Errorf("invalid scale output stored by dokku: %v", line)
}
processType := s[0]
count, err := strconv.Atoi(s[1])
if err != nil {