chore: always sort returned formations

This commit is contained in:
Jose Diaz-Gonzalez
2024-02-11 21:12:25 -05:00
parent 0102d219f3
commit 31abd7e31e
2 changed files with 1 additions and 3 deletions

View File

@@ -212,6 +212,7 @@ func getFormations(appName string) (FormationSlice, error) {
formations = append(formations, formation)
}
sort.Sort(formations)
return formations, nil
}
@@ -236,7 +237,6 @@ func scaleReport(appName string) error {
content = append(content, "proctype=qty", "--------=---")
}
sort.Sort(formations)
for _, formation := range formations {
content = append(content, fmt.Sprintf("%s=%d", formation.ProcessType, formation.Quantity))
}

View File

@@ -6,7 +6,6 @@ import (
"os"
"path"
"path/filepath"
"sort"
"strconv"
"strings"
@@ -298,7 +297,6 @@ func TriggerPsCurrentScale(appName string) error {
return err
}
sort.Sort(formations)
lines := []string{}
for _, formation := range formations {
lines = append(lines, fmt.Sprintf("%s=%d", formation.ProcessType, formation.Quantity))