From 58562e3626fc9e1d2e7c78af4312a760d5916f8a Mon Sep 17 00:00:00 2001 From: Dimitra Chatzichrysou <dimitra.chatzichrysou@cern.ch> Date: Fri, 22 Apr 2022 10:28:59 +0200 Subject: [PATCH] Fix for checking status on backup ClusterTask --- Dockerfile | 7 ++++--- chart/drupal-operations/templates/drupalsite-backup.yaml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34a4264..d7ffb2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,14 +6,15 @@ LABEL maintainer="Drupal Admins <drupal-admins@cern.ch>" # TODO: Download the binary for restic install, instead of using copart/restic repo ARG restic_version=0.12.1 -RUN yum install epel-release -y && \ +RUN yum update -y && \ + yum install epel-release -y && \ # install restic yum install yum-plugin-copr -y && \ yum copr enable copart/restic -y && \ yum install restic-${restic_version} -y && \ # we need this to interact with manila OpenStack to get CephFS information - yum install centos-release-openstack-train -y && \ - yum install -y /usr/bin/openstack --disableplugin=protectbase && \ + yum install centos-release-openstack-xena -y && \ + yum install -y /usr/bin/openstack python3-requests-kerberos && \ yum clean all COPY ./tekton-task-templates /tekton-task-templates diff --git a/chart/drupal-operations/templates/drupalsite-backup.yaml b/chart/drupal-operations/templates/drupalsite-backup.yaml index 964d32a..855da4a 100644 --- a/chart/drupal-operations/templates/drupalsite-backup.yaml +++ b/chart/drupal-operations/templates/drupalsite-backup.yaml @@ -38,6 +38,6 @@ spec: export PROJECT_HASH=$(printf '%s' "$NAMESPACE" | md5sum | awk '{print $1}') export VELERO_NAMESPACE={{ .Values.veleroNamespace }} 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' + 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") echo "DrupalSite backup status: $backupStatus" -- GitLab