diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 3d89f2ce8..1181a9cff 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -1833,7 +1833,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x - Description: Sets the scale for an app based on a specified formation (process-type=quantity). Any unspecified process types will be left as is. - Invoked by: -- Arguments: `$APP $SKIP_DEPLOY [$PROCESS_TUPLE...]` +- Arguments: `$APP $SKIP_DEPLOY $CLEAR_EXISTING [$PROCESS_TUPLE...]` - Example: ```shell diff --git a/plugins/app-json/functions.go b/plugins/app-json/functions.go index 7ca481fc4..41f671295 100644 --- a/plugins/app-json/functions.go +++ b/plugins/app-json/functions.go @@ -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)) } diff --git a/plugins/ps/src/triggers/triggers.go b/plugins/ps/src/triggers/triggers.go index bad436b7b..b1581f446 100644 --- a/plugins/ps/src/triggers/triggers.go +++ b/plugins/ps/src/triggers/triggers.go @@ -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, "", "") diff --git a/plugins/ps/triggers.go b/plugins/ps/triggers.go index fbd7ae922..49b631f1d 100644 --- a/plugins/ps/triggers.go +++ b/plugins/ps/triggers.go @@ -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) }