From 247698fea6b60f52f2f2ef5f2df41d3eee5ab151 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 1 Aug 2021 16:07:55 -0400 Subject: [PATCH] refactor: move can-scale check out to command If the internals call ps-set-scale, we should always respect it. --- plugins/ps/functions.go | 4 ---- plugins/ps/subcommands.go | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/ps/functions.go b/plugins/ps/functions.go index 3a1b6abd9..e62a4064d 100644 --- a/plugins/ps/functions.go +++ b/plugins/ps/functions.go @@ -381,10 +381,6 @@ func scaleReport(appName string) error { } func scaleSet(appName string, skipDeploy bool, processTuples []string) error { - if !canScaleApp(appName) { - return fmt.Errorf("App %s contains DOKKU_SCALE file and cannot be manually scaled", appName) - } - scale, err := parseProcessTuples(processTuples) if err != nil { return err diff --git a/plugins/ps/subcommands.go b/plugins/ps/subcommands.go index 9c675f872..ed15efcf7 100644 --- a/plugins/ps/subcommands.go +++ b/plugins/ps/subcommands.go @@ -134,6 +134,10 @@ func CommandScale(appName string, skipDeploy bool, processTuples []string) error return scaleReport(appName) } + if !canScaleApp(appName) { + return fmt.Errorf("App %s contains DOKKU_SCALE file and cannot be manually scaled", appName) + } + return scaleSet(appName, skipDeploy, processTuples) }