refactor: allow specifying clearExisting when calling ps-set-scale
This commit is contained in:
@@ -496,7 +496,9 @@ func setScale(appName string, image string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
args := []string{appName, "true"}
|
||||
skipDeploy := true
|
||||
clearExisting := false
|
||||
args := []string{appName, strconv.FormatBool(skipDeploy), strconv.FormatBool(clearExisting)}
|
||||
for processType, formation := range appJSON.Formation {
|
||||
args = append(args, fmt.Sprintf("%s=%d", processType, formation.Quantity))
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ func main() {
|
||||
appName := flag.Arg(0)
|
||||
appName, args := common.ShiftString(flag.Args())
|
||||
skipDeploy, processTuples := common.ShiftString(args)
|
||||
err = ps.TriggerPsSetScale(appName, common.ToBool(skipDeploy), processTuples)
|
||||
clearExisting, processTuples := common.ShiftString(args)
|
||||
err = ps.TriggerPsSetScale(appName, common.ToBool(skipDeploy), common.ToBool(clearExisting), processTuples)
|
||||
case "report":
|
||||
appName := flag.Arg(0)
|
||||
err = ps.ReportSingleApp(appName, "", "")
|
||||
|
||||
@@ -315,6 +315,6 @@ func TriggerPsCurrentScale(appName string) error {
|
||||
}
|
||||
|
||||
// TriggerPsSetScale configures the scale parameters for a given app
|
||||
func TriggerPsSetScale(appName string, skipDeploy bool, processTuples []string) error {
|
||||
return scaleSet(appName, skipDeploy, true, processTuples)
|
||||
func TriggerPsSetScale(appName string, skipDeploy bool, clearExisting bool, processTuples []string) error {
|
||||
return scaleSet(appName, skipDeploy, clearExisting, processTuples)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user