refactor: use ps-current-scale instead of parsing DOKKU_SCALE file when iterating over deployed processes

This commit is contained in:
Jose Diaz-Gonzalez
2021-08-01 01:43:35 -04:00
parent c62bff3002
commit 213f7d224c
9 changed files with 67 additions and 29 deletions

View File

@@ -7,7 +7,6 @@ source "$PLUGIN_AVAILABLE_PATH/checks/functions"
check_all_processes() {
local APP="$1"
CHECK_PROC_TYPE="$2"
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
local VALID_CHECK_PROC_TYPE=false
local line
@@ -30,7 +29,7 @@ check_all_processes() {
fi
check_process_type "$APP" "$PROC_TYPE" "$PROC_COUNT"
done <"$DOKKU_SCALE_FILE"
done <"$(plugn trigger ps-current-scale "$APP")"
if [[ "$VALID_CHECK_PROC_TYPE" == "false" ]]; then
dokku_log_fail "Invalid process type specified ($APP.$CHECK_PROC_TYPE)"