#!/bin/bash # setup-credentials.sh - Script to help setup credentials for Velero testing # Directory where Velero credentials are stored on the production system # This would be your production system's credentials for accessing MinIO VELERO_CREDS_PATH="${HOME}/.velero/credentials-velero" if [ -f "${VELERO_CREDS_PATH}" ]; then echo "Found Velero credentials at ${VELERO_CREDS_PATH}" # Extract AWS credentials from the file AWS_ACCESS_KEY_ID=$(grep aws_access_key_id ${VELERO_CREDS_PATH} | cut -d= -f2 | tr -d '[:space:]') AWS_SECRET_ACCESS_KEY=$(grep aws_secret_access_key ${VELERO_CREDS_PATH} | cut -d= -f2 | tr -d '[:space:]') if [ -n "${AWS_ACCESS_KEY_ID}" ] && [ -n "${AWS_SECRET_ACCESS_KEY}" ]; then echo "Credentials found and will be used for backup testing" # Store them temporarily for the test script to use cat > /tmp/velero-test-credentials <