Skip to content

Commit d73952e

Browse files
authored
fix broken wait_for_deployment function (#2631)
1 parent ec06069 commit d73952e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cp3pt0-deployment/common/utils.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,11 @@ function patch_watch_namespace() {
473473
function wait_for_deployment() {
474474
local namespace=$1
475475
local name=$2
476+
local retries="${3:-10}"
476477
local needReplicas=$(${OC} -n ${namespace} get deployment ${name} --no-headers --ignore-not-found -o jsonpath='{.spec.replicas}' | awk '{print $1}')
477478
local readyReplicas="${OC} -n ${namespace} get deployment ${name} --no-headers --ignore-not-found -o jsonpath='{.status.readyReplicas}' | grep '${needReplicas}'"
478479
local replicas="${OC} -n ${namespace} get deployment ${name} --no-headers --ignore-not-found -o jsonpath='{.status.replicas}' | grep '${needReplicas}'"
479480
local condition="(${readyReplicas} && ${replicas})"
480-
if [[ $3 != "" ]]; then
481-
local retries=$3
482-
else
483-
local retries=10
484-
fi
485481
local sleep_time=30
486482
local total_time_mins=$(( sleep_time * retries / 60))
487483
local wait_message="Waiting for Deployment ${name} to be ready"

0 commit comments

Comments
 (0)