Skip to content

Commit

Permalink
wait for licensing instance deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Li <[email protected]>
  • Loading branch information
qpdpQ committed Oct 7, 2024
1 parent fdfd189 commit 7d6de17
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cp3pt0-deployment/common/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cp3pt0-deployment/setup_singleton.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7d6de17

Please sign in to comment.