Skip to content
Snippets Groups Projects
Commit 6a2e9700 authored by Vineet Reddy Rajula's avatar Vineet Reddy Rajula
Browse files

Hotfix: Add timeout to 'oc wait'

parent eda88a3a
No related branches found
No related tags found
No related merge requests found
Pipeline #2920099 passed
...@@ -32,7 +32,7 @@ spec: ...@@ -32,7 +32,7 @@ spec:
export NAMESPACE=$(params.namespace) export NAMESPACE=$(params.namespace)
export SERVING_POD_IMAGE=$(oc get -n "$NAMESPACE" "drupalsite/$DRUPALSITE" -o=jsonpath='{.status.servingPodImage}') export SERVING_POD_IMAGE=$(oc get -n "$NAMESPACE" "drupalsite/$DRUPALSITE" -o=jsonpath='{.status.servingPodImage}')
envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n "$NAMESPACE" -f - envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n "$NAMESPACE" -f -
oc wait --for=condition=complete "job/$TASK-$DRUPALSITE" oc wait --timeout=1h --for=condition=complete "job/$TASK-$DRUPALSITE" -n "$NAMESPACE"
jobStatus=$(oc get "job/$TASK-$DRUPALSITE" -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed") jobStatus=$(oc get "job/$TASK-$DRUPALSITE" -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
echo "Job status: $jobStatus" echo "Job status: $jobStatus"
echo "Job logs:" echo "Job logs:"
......
...@@ -33,7 +33,7 @@ spec: ...@@ -33,7 +33,7 @@ spec:
export NAMESPACE=$(params.namespace) export NAMESPACE=$(params.namespace)
export SERVING_POD_IMAGE=$(oc get -n $NAMESPACE drupalsite/$DRUPALSITE -o=jsonpath='{.status.servingPodImage}') export SERVING_POD_IMAGE=$(oc get -n $NAMESPACE drupalsite/$DRUPALSITE -o=jsonpath='{.status.servingPodImage}')
envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n $NAMESPACE -f - envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n $NAMESPACE -f -
oc wait --for=condition=complete job/$TASK-$DRUPALSITE oc wait --timeout=1h --for=condition=complete job/$TASK-$DRUPALSITE -n "$NAMESPACE"
jobStatus=$(oc get job/$TASK-$DRUPALSITE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed") jobStatus=$(oc get job/$TASK-$DRUPALSITE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
echo "Job status: $jobStatus" echo "Job status: $jobStatus"
echo "Job logs:" echo "Job logs:"
......
...@@ -37,7 +37,7 @@ spec: ...@@ -37,7 +37,7 @@ spec:
export OPERATIONS_IMAGE={{ .Values.image }} export OPERATIONS_IMAGE={{ .Values.image }}
export RESTORE_SERVICE_ACCOUNT={{ .Values.restoreServiceAccount }} export RESTORE_SERVICE_ACCOUNT={{ .Values.restoreServiceAccount }}
envsubst < /tekton-task-templates/restore_pv_job.yaml | oc create -f - envsubst < /tekton-task-templates/restore_pv_job.yaml | oc create -f -
oc wait --for=condition=complete "job/$TASK-$DRUPALSITE" -n "$VELERO_NAMESPACE" oc wait --timeout=1h --for=condition=complete "job/$TASK-$DRUPALSITE" -n "$VELERO_NAMESPACE"
jobStatus=$(oc get job/$TASK-$DRUPALSITE -n $VELERO_NAMESPACE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed") jobStatus=$(oc get job/$TASK-$DRUPALSITE -n $VELERO_NAMESPACE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
echo "Files restore Job status: $jobStatus" echo "Files restore Job status: $jobStatus"
echo "Files restore Job logs:" echo "Files restore Job logs:"
...@@ -51,7 +51,7 @@ spec: ...@@ -51,7 +51,7 @@ spec:
export OPERATION="database-restore" export OPERATION="database-restore"
export ARGS="-f 'database_backup.sql'" export ARGS="-f 'database_backup.sql'"
envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n "$NAMESPACE" -f - envsubst < /tekton-task-templates/drupal_operation_job.yaml | oc create -n "$NAMESPACE" -f -
oc wait --for=condition=complete job/$TASK-$DRUPALSITE oc wait --timeout=1h --for=condition=complete job/$TASK-$DRUPALSITE -n "$NAMESPACE"
jobStatus=$(oc get job/$TASK-$DRUPALSITE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed") jobStatus=$(oc get job/$TASK-$DRUPALSITE -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo "Failed")
echo "Database restore Job status: $jobStatus" echo "Database restore Job status: $jobStatus"
echo "Database restore Job logs:" echo "Database restore Job logs:"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment