From cbaa6d98338dedb71c76b2237f39a65ea568b26b Mon Sep 17 00:00:00 2001 From: Conor Brady Date: Thu, 8 Feb 2024 13:14:02 -0800 Subject: [PATCH] Fix S3 cleanup job (#3396) --- openshift/s3-backup/docker/cleanup_bucket.sh | 9 +-------- openshift/scripts/oc_provision_backup_s3_cleanup.sh | 4 +--- openshift/templates/backup-s3-cleanup-job.yaml | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/openshift/s3-backup/docker/cleanup_bucket.sh b/openshift/s3-backup/docker/cleanup_bucket.sh index f9b4cc156..c8d805b1c 100755 --- a/openshift/s3-backup/docker/cleanup_bucket.sh +++ b/openshift/s3-backup/docker/cleanup_bucket.sh @@ -3,7 +3,7 @@ # DANGER! Don't run this in production! # usage example: -# AWS_HOSTNAME=[your aws hostname] AWS_ACCESS_KEY=[your access key] AWS_SECRET_KEY=[your secret key] AWS_BUCKET=[your aws bucket] PG_HOSTNAME=localhost PG_DATABASE=wps ./cleanup_bucket.sh +# AWS_HOSTNAME=[your aws hostname] AWS_ACCESS_KEY=[your access key] AWS_SECRET_KEY=[your secret key] AWS_BUCKET=[your aws bucket] ./cleanup_bucket.sh # variable checks if [ -z ${SUFFIX+0} ] @@ -19,13 +19,6 @@ then exit 1 fi -if [ -z ${PG_DATABASE+0} ] -then - echo "PG_DATABASE not specified" - echo "Specify a postgress database" - exit 1 -fi - if [ -z ${AWS_HOSTNAME+0} ] then echo "AWS_HOSTNAME not specified" diff --git a/openshift/scripts/oc_provision_backup_s3_cleanup.sh b/openshift/scripts/oc_provision_backup_s3_cleanup.sh index f04a0cd00..cb2f82a3b 100755 --- a/openshift/scripts/oc_provision_backup_s3_cleanup.sh +++ b/openshift/scripts/oc_provision_backup_s3_cleanup.sh @@ -16,14 +16,12 @@ source "$(dirname ${0})/common/common" #% #% ${THIS_FILE} pr-0 -CLUSTER_NAME="patroni-${APP_NAME}-${SUFFIX}" JOB="job/cleanup-s3-wps-${SUFFIX}" # create the job oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/backup-s3-cleanup-job.yaml \ -p SUFFIX=${SUFFIX} \ - -p PROJ_TOOLS=${PROJ_TOOLS} \ - -p CLUSTER_NAME=${CLUSTER_NAME} | jq '.items[0]' | oc -n ${PROJ_TARGET} create -f - + -p PROJ_TOOLS=${PROJ_TOOLS} | jq '.items[0]' | oc -n ${PROJ_TARGET} create -f - # wait for the job to finish oc wait --for=condition=complete ${JOB} --timeout=60s # output the log for debugging diff --git a/openshift/templates/backup-s3-cleanup-job.yaml b/openshift/templates/backup-s3-cleanup-job.yaml index 1ac977e68..3c3cf464d 100644 --- a/openshift/templates/backup-s3-cleanup-job.yaml +++ b/openshift/templates/backup-s3-cleanup-job.yaml @@ -12,8 +12,6 @@ parameters: value: wps-global - name: PROJ_TOOLS required: true - - name: CLUSTER_NAME - required: true - name: "TAG_NAME" displayName: "Environment TAG name" description: "The TAG name for this environment, e.g., dev, test, prod"