diff --git a/chart/drupal-operations/templates/drupalsite-backup.yaml b/chart/drupal-operations/templates/drupalsite-backup.yaml index 855da4a660e8a4a8f8dabcfd1d500784392f2a03..69df2354b5b97d640459d6960691aa316057eda1 100644 --- a/chart/drupal-operations/templates/drupalsite-backup.yaml +++ b/chart/drupal-operations/templates/drupalsite-backup.yaml @@ -37,6 +37,7 @@ spec: export RESOURCE_NAME=$NAMESPACE-$BACKUP_NAME-$TIMESTAMP_HASH export PROJECT_HASH=$(printf '%s' "$NAMESPACE" | md5sum | awk '{print $1}') export VELERO_NAMESPACE={{ .Values.veleroNamespace }} + export VELERO_BACKUP_STORAGE_LOCATION={{ .Values.veleroBackupStorageLocation }} envsubst < /tekton-task-templates/backup_resource.yaml | oc create -f - timeout 120s sh -c -- 'while [[ $(oc get "backup/$RESOURCE_NAME" -n "$VELERO_NAMESPACE" -o jsonpath='{.status.phase}') != "Completed" ]]; do printf "Backup in progress\n"; sleep 2s; done' backupStatus=$(oc get backup/$RESOURCE_NAME -n $VELERO_NAMESPACE -o=jsonpath='{.status.phase}' | grep -i -E 'failed|completed|partiallyfailed' || echo "Failed") diff --git a/chart/drupal-operations/values.yaml b/chart/drupal-operations/values.yaml index 990f94c4f80b061f25a247bc7817367c30418758..d18c12672e256d280d982288ac7ccdeaaee148f2 100644 --- a/chart/drupal-operations/values.yaml +++ b/chart/drupal-operations/values.yaml @@ -1,3 +1,4 @@ image: gitlab-registry.cern.ch/drupal/paas/drupal-operations/openshift-cli:velero-restore restoreServiceAccount: "" veleroNamespace: "" +veleroBackupStorageLocation: "default" diff --git a/tekton-task-templates/backup_resource.yaml b/tekton-task-templates/backup_resource.yaml index f6d193c13eecc1495e5d6b63a32720ea4318f0fd..09da9d7323791afa4aeb87aadc3189fb2180e073 100644 --- a/tekton-task-templates/backup_resource.yaml +++ b/tekton-task-templates/backup_resource.yaml @@ -25,5 +25,6 @@ spec: matchLabels: app: drupal drupalSite: $DRUPALSITE + storageLocation: $VELERO_BACKUP_STORAGE_LOCATION ttl: 87600h0m0s # 10 years (prevent cleanup of on-demand backups) status: {}