Skip to content

Commit 69832ec

Browse files
authored
conditionally wait for ibm-licensing-instance (#2252)
* conditionally wait for ibm-licensing-instance Signed-off-by: Allen Li <liyuchen223@gmail.com> * check licensing deployment exist or not Signed-off-by: Allen Li <liyuchen223@gmail.com> * remove duplicate licensing deployment check Signed-off-by: Allen Li <liyuchen223@gmail.com> * add some log Signed-off-by: Allen Li <liyuchen223@gmail.com> --------- Signed-off-by: Allen Li <liyuchen223@gmail.com>
1 parent 8b85fa1 commit 69832ec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cp3pt0-deployment/common/utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ function wait_for_licensing_instance_deployment() {
498498
if [ -z "$ns" ]; then
499499
info "RETRYING: Waiting for Deployment ibm-licensing-service-instance to be ready (${retries} left)"
500500
else
501-
break
501+
info "Found licensing instance"
502+
break
502503
fi
503504

504505
((retries--))

cp3pt0-deployment/setup_singleton.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,11 @@ function is_migrate_licensing() {
231231
fi
232232

233233
title "Check migrating LTSR ibm-licensing-operator"
234-
wait_for_licensing_instance_deployment
235-
local ns=$("$OC" get deployments -A | grep ibm-licensing-service-instance | cut -d ' ' -f1)
236-
if [ -z "$ns" ]; then
234+
# wait for ibm-licensing-operator instance
235+
local licensing_operator_exist=$("$OC" get deployment -A | (grep ibm-licensing-operator || echo "fail"))
236+
if [[ $licensing_operator_exist != "fail" ]]; then
237+
wait_for_licensing_instance_deployment
238+
else
237239
info "No LTSR ibm-licensing-operator to migrate, skipping"
238240
return 0
239241
fi

0 commit comments

Comments
 (0)