From 882507c492ef6c052ecb9c0d110f1884b725ca32 Mon Sep 17 00:00:00 2001 From: Kyle Ong Date: Mon, 26 Sep 2022 15:13:06 -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 that assumption and looks for the job_name in the regex [#182735363](https://www.pivotaltracker.com/story/show/182735363) 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 9e941d58..412a1bb7 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 -- 2.34.1