From 27ebf827f21bddac4391825cc7d79dc36d4e3470 Mon Sep 17 00:00:00 2001
From: Dimitra Chatzichrysou <dimitra.chatzichrysou@cern.ch>
Date: Thu, 27 Jan 2022 12:04:54 +0100
Subject: [PATCH 1/2] Update command for fetching pod name

---
 velero-restic-restore/restore_pvs.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/velero-restic-restore/restore_pvs.sh b/velero-restic-restore/restore_pvs.sh
index 27aaf7b..ac471fc 100755
--- a/velero-restic-restore/restore_pvs.sh
+++ b/velero-restic-restore/restore_pvs.sh
@@ -38,8 +38,9 @@ chmod 777 /restore
 
 restic -p /tmp/repository-password -r "$RESTIC_REPO" restore "$RESTIC_SNAPSHOT_ID" --target /restore
 
-# Fetch the pod name from the drupalSite env var
-POD_NAME=`oc get pods -l app=drupal,drupalSite="$DRUPALSITE" -o name -n "$NAMESPACE" | sed "s/pod\///g" | head -n 1`
+# Fetch the most recent pod name from the drupalSite env var
+sleep 60s
+POD_NAME=`oc get pod -l app=drupal,drupalSite="$DRUPALSITE" -n "$NAMESPACE" --sort-by=.metadata.creationTimestamp --field-selector=status.phase==Running -o jsonpath="{.items[-1:].metadata.name}"`
 validateVar "$POD_NAME" "POD_NAME"
 
 oc rsync /restore/ "$POD_NAME":/drupal-data  --delete -n "$NAMESPACE" -c php-fpm
-- 
GitLab


From f9b608cfae90cdfefb5b0d6c9301b46caae8cb77 Mon Sep 17 00:00:00 2001
From: Vineet Reddy Rajula <rajula.vineet.reddy@cern.ch>
Date: Thu, 27 Jan 2022 15:59:36 +0100
Subject: [PATCH 2/2] Bump restic version to fix image build

---
 Dockerfile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index d8e27c1..34a4264 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,9 @@ FROM gitlab-registry.cern.ch/paas-tools/openshift-client
 
 LABEL maintainer="Drupal Admins <drupal-admins@cern.ch>"
 
-ARG restic_version=0.12.0
+# https://copr.fedorainfracloud.org/coprs/copart/restic/ repo only supporting a fixed version of restic. Hence bumping up restic version from 0.12.0 to 0.12.1
+# 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 && \
     # install restic
-- 
GitLab