Skip to content
Snippets Groups Projects

Update command for fetching pod name

Merged Dimitra Chatzichrysou requested to merge fix-restore-pvs into master
1 unresolved thread
2 files
+ 6
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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
Loading