From 257ed54ddbab16109c74873a77cdae08e7ef13ae Mon Sep 17 00:00:00 2001 From: Sophie Huang Date: Tue, 11 Jan 2022 21:14:39 +0000 Subject: [PATCH] Uplift HTK stable commit (db-backup-restore) 1) Uplift helm-toolkit to include db-backup-restore error log string prefixes for the generation of alert https://review.opendev.org/c/openstack/openstack-helm-infra/+/823867 2) Error log string prefixes are added to etcd backup-restore as well Change-Id: Iad51a3e55567d0861140a97c17a1b7d859e13938 --- charts/etcd/templates/bin/_etcdbackup.tpl | 8 ++++---- tools/helm_tk.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/etcd/templates/bin/_etcdbackup.tpl b/charts/etcd/templates/bin/_etcdbackup.tpl index 3494ef5a..9cf0d505 100644 --- a/charts/etcd/templates/bin/_etcdbackup.tpl +++ b/charts/etcd/templates/bin/_etcdbackup.tpl @@ -42,17 +42,17 @@ dump_databases_to_directory() { BACKUP_RETURN_CODE=$? if [[ $BACKUP_RETURN_CODE != 0 ]]; then log ERROR $DB_NAME "There was an error backing up the databases." $LOG_FILE - exit $BACKUP_RETURN_CODE + return $BACKUP_RETURN_CODE fi } if ! [ -x "$(which etcdctl)" ]; then - log ERROR $DB_NAME "etcdctl not available, Please use the correct image." $LOG_FILE + log ERROR $DB_NAME "etcdctl not available, Please use the correct image." SKIP_BACKUP=1 fi if [ ! -d "$BACKUP_DIR" ]; then - log ERROR $DB_NAME "$BACKUP_DIR doesn't exist, Backup will not continue" $LOG_FILE + log ERROR $DB_NAME "$BACKUP_DIR doesn't exist, Backup will not continue" SKIP_BACKUP=1 fi @@ -60,6 +60,6 @@ if [ $SKIP_BACKUP -eq 0 ]; then # Call main program to start the database backup backup_databases else - log ERROR $DB_NAME "etcd backup failed." $LOG_FILE + log ERROR $DB_NAME "Backup of the ${DB_NAME} database failed. etcd backup failed." exit 1 fi diff --git a/tools/helm_tk.sh b/tools/helm_tk.sh index 34a0aa9d..13630d5b 100755 --- a/tools/helm_tk.sh +++ b/tools/helm_tk.sh @@ -17,7 +17,7 @@ set -eux HTK_REPO=${HTK_REPO:-"https://opendev.org/openstack/openstack-helm-infra.git"} -HTK_STABLE_COMMIT=${HTK_COMMIT:-"f4972121bcb41c8d74748917804d2b239ab757f9"} +HTK_STABLE_COMMIT=${HTK_COMMIT:-"11ac37056b1a45cdcdabe0aab239ab7fadd53b24"} TMP_DIR=$(mktemp -d)