diff --git a/plugins/ps/functions b/plugins/ps/functions index f217e6f0d..3b4270dff 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -100,7 +100,7 @@ set_scale() { for procscale in "${SCALE_SETTINGS[@]}"; do local PROC_NAME=${procscale%%=*} local PROC_COUNT=${procscale#*=} - if [[ -f "$DOKKU_PROCFILE" ]] && ! procfile-util exists --procfile "$DOKKU_PROCFILE" --process-type "$PROC_NAME" >/dev/null 2>&1; then + if [[ -f "$DOKKU_PROCFILE" ]] && [[ "$PROC_COUNT" != "0" ]] && ! procfile-util exists --procfile "$DOKKU_PROCFILE" --process-type "$PROC_NAME" >/dev/null 2>&1; then dokku_log_fail "${PROC_NAME} is not a valid process name" fi is_number "$PROC_COUNT" || dokku_log_fail "ps:scale $PROC_COUNT is not a number" diff --git a/tests/unit/10_ps-herokuish.bats b/tests/unit/10_ps-herokuish.bats index 8fc613441..3adc11150 100644 --- a/tests/unit/10_ps-herokuish.bats +++ b/tests/unit/10_ps-herokuish.bats @@ -109,11 +109,11 @@ teardown() { assert_success done - run /bin/bash -c "dokku ps:scale $TEST_APP web=0 worker=0" + run /bin/bash -c "dokku ps:scale $TEST_APP web=0 worker=0 invalid-process=0" echo "output: $output" echo "status: $status" assert_success - for PROC_TYPE in web worker; do + for PROC_TYPE in web worker invalid-process; do CIDS="" shopt -s nullglob for CID_FILE in $DOKKU_ROOT/$TEST_APP/CONTAINER.$PROC_TYPE.*; do