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 70ed4f1ca..070e84f74 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 @@ -126,17 +126,17 @@ data: info "Waiting for job $job_name to complete in namespace $CSDB_NAMESPACE." job_exists=$(oc get job $job_name -n $CSDB_NAMESPACE --no-headers || echo fail) if [[ $job_exists != "fail" ]]; then - completed=$(oc get job $job_name -n $CSDB_NAMESPACE -o jsonpath='{status.succeeded}') + completed=$(oc get job $job_name -n $CSDB_NAMESPACE --no-headers | awk '{print $2}') retry_count=20 - while [[ $completed != "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 -o jsonpath='{status.succeeded}') + completed=$(oc get job $job_name -n $CSDB_NAMESPACE --no-headers | awk '{print $2}') retry_count=$((retry_count-1)) done - if [[ $retry_count == 0 ]] && [[ $completed != "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."