From b6c75072c94dc59c41d689c925ec4491c9f8ecd4 Mon Sep 17 00:00:00 2001 From: Kyle Ong Date: Mon, 10 Oct 2022 11:08:30 -0700 Subject: [PATCH] monit_utils: Add support for more than 10 cc workers - https://github.com/cloudfoundry/capi-release/issues/267 identified a bug where the wait_unmonitor_job function assumed there would be less than 10 cloud controller workers - this fix removes the less than 10 worker assumption and looks for the job_name in the regex Authored-by: Kyle Ong --- src/capi_utils/monit_utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/capi_utils/monit_utils.sh b/src/capi_utils/monit_utils.sh index 9e941d58c2..412a1bb7b3 100755 --- a/src/capi_utils/monit_utils.sh +++ b/src/capi_utils/monit_utils.sh @@ -86,7 +86,7 @@ function wait_unmonitor_job() { local job_name="$1" while true; do - if [[ $(sudo /var/vcap/bosh/bin/monit summary | grep ${job_name} ) =~ not[[:space:]]monitored[[:space:]]*$ ]]; then + if [[ $(sudo /var/vcap/bosh/bin/monit summary | grep ${job_name} ) =~ .*${job_name}.*[[:space:]]not[[:space:]]monitored[[:space:]]; then echo "Unmonitored ${job_name}" return 0 else