diff --git a/cp3pt0-deployment/common/utils.sh b/cp3pt0-deployment/common/utils.sh index c0a0e4efe..af039adb6 100644 --- a/cp3pt0-deployment/common/utils.sh +++ b/cp3pt0-deployment/common/utils.sh @@ -483,6 +483,25 @@ function wait_for_deployment() { wait_for_condition "${condition}" ${retries} ${sleep_time} "${wait_message}" "${success_message}" "${error_message}" } +function wait_for_licensing_instance_deployment() { + # Retry and wait for the licensing instance to be available + retries=10 + while [[ $retries -gt 0 ]]; do + echo "Wait for licensing deployment to be ready..." + sleep 30 + ns=$("$OC" get deployments -A | grep ibm-licensing-service-instance | cut -d ' ' -f1) + + if [ -z "$ns" ]; then + info "RETRYING: Waiting for Deployment ibm-licensing-service-instance to be ready (${retries} left)" + else + break + fi + + ((retries--)) + done + +} + function wait_for_operator_upgrade() { local namespace=$1 local package_name=$2 diff --git a/cp3pt0-deployment/setup_singleton.sh b/cp3pt0-deployment/setup_singleton.sh index 032e8693d..149fe492e 100755 --- a/cp3pt0-deployment/setup_singleton.sh +++ b/cp3pt0-deployment/setup_singleton.sh @@ -231,6 +231,7 @@ function is_migrate_licensing() { fi title "Check migrating LTSR ibm-licensing-operator" + wait_for_licensing_instance_deployment local ns=$("$OC" get deployments -A | grep ibm-licensing-service-instance | cut -d ' ' -f1) if [ -z "$ns" ]; then info "No LTSR ibm-licensing-operator to migrate, skipping"