Commit b88b31cf authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #41242 from wojtek-t/dont_always_backup

Automatic merge from submit-queue (batch tested with PRs 41223, 40892, 41220, 41207, 41242) Backup etcd only before migration There is a bug currently that trigger backup on every run of a script (when we are running 2.2.1 version). @mml
parents 3b7440ca 5c0c445b
...@@ -152,7 +152,7 @@ ROLLBACK="${ROLLBACK:-/usr/local/bin/rollback}" ...@@ -152,7 +152,7 @@ ROLLBACK="${ROLLBACK:-/usr/local/bin/rollback}"
# If we are upgrading from 2.2.1 and this is the first try for upgrade, # If we are upgrading from 2.2.1 and this is the first try for upgrade,
# do the backup to allow restoring from it in case of failed upgrade. # do the backup to allow restoring from it in case of failed upgrade.
BACKUP_DIR="${DATA_DIRECTORY}/migration-backup" BACKUP_DIR="${DATA_DIRECTORY}/migration-backup"
if [ "${CURRENT_VERSION}" = "2.2.1" -a ! -d "${BACKUP_DIR}" ]; then if [ "${CURRENT_VERSION}" = "2.2.1" -a ! "${CURRENT_VERSION}" != "${TARGET_VERSION}" -a -d "${BACKUP_DIR}" ]; then
echo "Backup etcd before starting migration" echo "Backup etcd before starting migration"
mkdir ${BACKUP_DIR} mkdir ${BACKUP_DIR}
ETCDCTL_CMD="/usr/local/bin/etcdctl-2.2.1" ETCDCTL_CMD="/usr/local/bin/etcdctl-2.2.1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment