Skip to content

Commit

Permalink
update conditions
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Luzarraga <[email protected]>
  • Loading branch information
bluzarraga committed Dec 12, 2024
1 parent 664103a commit f53ce9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions velero/schedule/common-service-db/cs-db-br-script-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit f53ce9b

Please sign in to comment.