fix: zero out entries that don't exist in the scale file

This commit is contained in:
Jose Diaz-Gonzalez
2020-11-18 12:27:56 -05:00
parent be26f45b5a
commit 702e9cf66c

View File

@@ -407,6 +407,14 @@ func updateScalefile(appName string, scaleUpdates map[string]int) error {
scale[processType] = count
}
for processType := range validProcessTypes {
count, ok := scale[processType]
if !ok {
count = 0
}
scale[processType] = count
}
content := []string{}
for processType, count := range scale {
content = append(content, fmt.Sprintf("%s=%d", processType, count))