diff --git a/Dockerfile b/Dockerfile index d8e27c1c58605f2956507077e5f50bdc555ac81f..34a426459d09bfc42fe78bb959a13842d07e862f 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 diff --git a/velero-restic-restore/restore_pvs.sh b/velero-restic-restore/restore_pvs.sh index 27aaf7b5b9360f0cacbae893936537e6233a55f5..ac471fc5b4bc1d41229a431258a81a64ffc1efe4 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