From fb3a70d9dc8f41afdfea1e1c581a4e0c079bbe90 Mon Sep 17 00:00:00 2001 From: Ben Luzarraga <31223504+bluzarraga@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:27:53 -0600 Subject: [PATCH] More consistently check OIDC job readiness (#2335) * add common-web-ui-config cm to labeling script Signed-off-by: Ben Luzarraga * update oidc wait logic Signed-off-by: Ben Luzarraga * update conditions Signed-off-by: Ben Luzarraga --------- Signed-off-by: Ben Luzarraga --- velero/schedule/common-service-db/cs-db-br-script-cm.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/velero/schedule/common-service-db/cs-db-br-script-cm.yaml b/velero/schedule/common-service-db/cs-db-br-script-cm.yaml index 0823c3351..1aea8eb39 100644 --- a/velero/schedule/common-service-db/cs-db-br-script-cm.yaml +++ b/velero/schedule/common-service-db/cs-db-br-script-cm.yaml @@ -153,15 +153,15 @@ data: if [[ $job_exists != "fail" ]]; then completed=$(oc get job $job_name -n $CSDB_NAMESPACE --no-headers | awk '{print $2}') retry_count=20 - while [[ $completed != "1/1" ]] && [[ $retry_count > 0 ]] + while [[ ( $completed != "1/1" && $completed != "Complete" ) ]] && [[ $retry_count > 0 ]] do info "Wait for job $job_name to complete. Try again in 15s." sleep 15 completed=$(oc get job $job_name -n $CSDB_NAMESPACE --no-headers | awk '{print $2}') - retry_count=$retry_count-1 + retry_count=$((retry_count-1)) done - if [[ $retry_count == 0 ]] && [[ $completed != "1/1" ]]; then + if [[ $retry_count == 0 ]] && [[ ( $completed != "1/1" && $completed != "Complete" ) ]]; then error "Timed out waiting for job $job_name." else info "Job $job_name completed."