aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-23 17:17:20 +0000
committerGerrit Code Review <review@openstack.org>2017-03-23 17:17:20 +0000
commitc1972e63999933adfb194f27b870e9196d57b0a1 (patch)
tree86cb258ab62af0a974952a39de0197deaf695b26 /docker
parent336b964f5379b56edbec476913a1b54137ee1de8 (diff)
parent6682d07addb9063a231199b3219bdcf6c932d218 (diff)
downloadkolla-c1972e63999933adfb194f27b870e9196d57b0a1.tar.gz
kolla-c1972e63999933adfb194f27b870e9196d57b0a1.zip
Merge "Implement Keystone zero-downtime upgrade"
Diffstat (limited to 'docker')
-rw-r--r--docker/keystone/keystone/extend_start.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/docker/keystone/keystone/extend_start.sh b/docker/keystone/keystone/extend_start.sh
index b509c7065..b29bf02a3 100644
--- a/docker/keystone/keystone/extend_start.sh
+++ b/docker/keystone/keystone/extend_start.sh
@@ -41,6 +41,25 @@ if [[ $(stat -c %a ${KEYSTONE_LOG_DIR}) != "755" ]]; then
chmod 755 ${KEYSTONE_LOG_DIR}
fi
+# Upgrade and exit if KOLLA_UPGRADE variable is set. This catches all cases
+# of the KOLLA_UPGRADE variable being set, including empty.
+if [[ "${!KOLLA_UPGRADE[@]}" ]]; then
+ # TODO(duonghq): check doctor result here
+ # TODO: find reason why doctor failed in gate
+ # sudo -H -u keystone keystone-manage doctor
+ sudo -H -u keystone keystone-manage db_sync --expand
+ sudo -H -u keystone keystone-manage db_sync --migrate
+ exit 0
+fi
+
+# Contract database and exit if KOLLA_FINISH_UPGRADE variable is set.
+# This catches all cases of the KOLLA_FINISH_UPGRADE variable being set,
+# including empty.
+if [[ "${!KOLLA_FINISH_UPGRADE[@]}" ]]; then
+ sudo -H -u keystone keystone-manage db_sync --contract
+ exit 0
+fi
+
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then