feat: return an error when an invalid scale count is encountered

Closes #5710
This commit is contained in:
Jose Diaz-Gonzalez
2023-03-18 05:07:03 -04:00
parent c8abd803bd
commit 07e0eb4e50

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 {