From 89d290d3da0a5e66794c3848d15829764fa48819 Mon Sep 17 00:00:00 2001 From: "Vladimir Sigunov (vs422h)" Date: Tue, 3 May 2022 13:44:00 -0400 Subject: [PATCH] [Database] Remote backup should keep given number of backup days Fixes minor issue with naming of variables which prevents the script to be compliant the backup retention policy. Change-Id: Ic241310a66af92ee423f5c762c413af7d6d53f0b --- helm-toolkit/Chart.yaml | 2 +- .../templates/scripts/db-backup-restore/_backup_main.sh.tpl | 4 ++-- releasenotes/notes/helm-toolkit.yaml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helm-toolkit/Chart.yaml b/helm-toolkit/Chart.yaml index 6393d6e00..8821349d5 100644 --- a/helm-toolkit/Chart.yaml +++ b/helm-toolkit/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Helm-Toolkit name: helm-toolkit -version: 0.2.41 +version: 0.2.42 home: https://docs.openstack.org/openstack-helm icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png sources: diff --git a/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl b/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl index d3fe4fdee..516d79ee7 100755 --- a/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl +++ b/helm-toolkit/templates/scripts/db-backup-restore/_backup_main.sh.tpl @@ -368,8 +368,8 @@ remove_old_remote_archives() { count=0 SECONDS_TO_KEEP=$((${REMOTE_DAYS_TO_KEEP}*86400)) log INFO "${DB_NAME}_backup" "Deleting backups older than ${REMOTE_DAYS_TO_KEEP} days (${SECONDS_TO_KEEP} seconds)" - for INDEX in $(tr " " "\n" <<< ${!FILETABLE[@]} | sort -n -); do - ARCHIVE_FILE=${FILETABLE[${INDEX}]} + for INDEX in $(tr " " "\n" <<< ${!fileTable[@]} | sort -n -); do + ARCHIVE_FILE=${fileTable[${INDEX}]} if [[ ${INDEX} -lt ${SECONDS_TO_KEEP} || ${count} -lt ${REMOTE_DAYS_TO_KEEP} ]]; then ((count++)) log INFO "${DB_NAME}_backup" "Keeping remote backup(s) ${ARCHIVE_FILE}." diff --git a/releasenotes/notes/helm-toolkit.yaml b/releasenotes/notes/helm-toolkit.yaml index 322ecc01a..b19f33d58 100644 --- a/releasenotes/notes/helm-toolkit.yaml +++ b/releasenotes/notes/helm-toolkit.yaml @@ -48,4 +48,5 @@ helm-toolkit: - 0.2.39 Removed tillerVersion from Chart to pass helm3 linting - 0.2.40 Revert chart naming for subchart compatibility - 0.2.41 Database B/R - archive name parser added + - 0.2.42 Database B/R - fix to make script compliant with a retention policy ...