From 6d4dcc247440654c9f7072b6c6bcba338d55692b Mon Sep 17 00:00:00 2001 From: Gayathri Devi Kathiri Date: Fri, 28 May 2021 16:28:55 +0530 Subject: [PATCH] Add manual mode to the created backup file name This PS helps us understand the mode of backup taken from the created backup file name. Supporting PS: https://review.opendev.org/c/airship/porthole/+/793591 Change-Id: I96c8b856fc309381f8d956eaae248bfc3443d900 --- helm-toolkit/Chart.yaml | 2 +- .../scripts/db-backup-restore/_backup_main.sh.tpl | 7 ++++++- releasenotes/notes/helm-toolkit.yaml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/helm-toolkit/Chart.yaml b/helm-toolkit/Chart.yaml index 8ff554dfa..f6e3f7987 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.15 +version: 0.2.16 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 800f0b5b5..d4e104c90 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 @@ -22,6 +22,7 @@ # export REMOTE_DAYS_TO_KEEP Number of days to keep the remote backups # export ARCHIVE_DIR Local location where the backup tarballs should # be stored. (full directory path) +# export BACK_UP_MODE Determines the mode of backup taken. # export REMOTE_BACKUP_ENABLED "true" if remote backup enabled; false # otherwise # export CONTAINER_NAME Name of the container on the RGW to store @@ -314,7 +315,11 @@ backup_databases() { log INFO "${DB_NAME}_backup" "Databases dumped successfully. Creating tarball..." NOW=$(date +"%Y-%m-%dT%H:%M:%SZ") - TARBALL_FILE="${DB_NAME}.${DB_NAMESPACE}.${SCOPE}.${NOW}.tar.gz" + if [[ -z "${BACK_UP_MODE}" ]]; then + TARBALL_FILE="${DB_NAME}.${DB_NAMESPACE}.${SCOPE}.${NOW}.tar.gz" + else + TARBALL_FILE="${DB_NAME}.${DB_NAMESPACE}.${SCOPE}.${BACK_UP_MODE}.${NOW}.tar.gz" + fi cd $TMP_DIR || log_backup_error_exit "Cannot change to directory $TMP_DIR" diff --git a/releasenotes/notes/helm-toolkit.yaml b/releasenotes/notes/helm-toolkit.yaml index a0014c260..0fe99def5 100644 --- a/releasenotes/notes/helm-toolkit.yaml +++ b/releasenotes/notes/helm-toolkit.yaml @@ -22,4 +22,5 @@ helm-toolkit: - 0.2.13 Modify connection args for s3 bucket creation when TLS is enabled - 0.2.14 Remove TLS_OPTION argument from s3 bucket creation job - 0.2.15 Adding TLS rabbitmq logic + - 0.2.16 Add manual mode to the created backup file name ...