From bcc142659af423f76a000f4d99328b8b79f55a4e Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Sun, 24 Jan 2021 12:38:43 -0500 Subject: [PATCH 1/2] ENVIRONMENT_TYPE will be added automatically later, not needed here --- images/oc-build-deploy-dind/build-deploy-docker-compose.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh index d232115892..2538fef37b 100755 --- a/images/oc-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/oc-build-deploy-dind/build-deploy-docker-compose.sh @@ -846,9 +846,6 @@ if oc --insecure-skip-tls-verify -n ${OPENSHIFT_PROJECT} get schedules.backup.ap PRODUCTION_WEEKLY_BACKUP_RETENTION=$(cat .lagoon.yml | shyaml get-value backup-retention.production.weekly "") PRODUCTION_DAILY_BACKUP_RETENTION=$(cat .lagoon.yml | shyaml get-value backup-retention.production.daily "") - # Pull in environment type (development/production) - TEMPLATE_PARAMETERS+=(-p ENVIRONMENT_TYPE="${ENVIRONMENT_TYPE}") - # Set template parameters for retention values (prefer .lagoon.yml values over supplied defaults after ensuring they are valid integers via "-eq" comparison) if [ ! -z $PRODUCTION_MONTHLY_BACKUP_RETENTION ] && [ "$PRODUCTION_MONTHLY_BACKUP_RETENTION" -eq "$PRODUCTION_MONTHLY_BACKUP_RETENTION" ] && [ $ENVIRONMENT_TYPE = 'production']; then TEMPLATE_PARAMETERS+=(-p MONTHLY_BACKUP_RETENTION="${PRODUCTION_MONTHLY_BACKUP_RETENTION}") From e7d5559b6530285c7d8eaeb4dd3013501fbdc489 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Sun, 24 Jan 2021 12:53:03 -0500 Subject: [PATCH 2/2] add default retention to yaml in case it's not given we don't error --- .../openshift-templates/backup-schedule.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/images/oc-build-deploy-dind/openshift-templates/backup-schedule.yml b/images/oc-build-deploy-dind/openshift-templates/backup-schedule.yml index 79c4ee0529..1d7fe5040c 100644 --- a/images/oc-build-deploy-dind/openshift-templates/backup-schedule.yml +++ b/images/oc-build-deploy-dind/openshift-templates/backup-schedule.yml @@ -45,13 +45,13 @@ parameters: required: true - name: MONTHLY_BACKUP_RETENTION description: How many monthly backups should be retained after pruning - required: true + value: '1' - name: WEEKLY_BACKUP_RETENTION description: How many weekly backups should be retained after pruning - required: true + value: '4' - name: DAILY_BACKUP_RETENTION description: How many daily backups should be retained after pruning - required: true + value: '7' - name: ENVIRONMENT_TYPE description: What type of environment this is (production/development) required: true