Merge "Apply Glance database migration"

This commit is contained in:
Zuul 2018-04-10 08:58:26 +00:00 committed by Gerrit Code Review
commit a4c5f2644e
2 changed files with 23 additions and 0 deletions

View File

@ -7,3 +7,21 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
glance-manage db_load_metadefs
exit 0
fi
# Migrate database 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
if [[ "${!GLANCE_DB_EXPAND[@]}" ]]; then
echo "Expanding database"
glance-manage db expand
fi
if [[ "${!GLANCE_DB_MIGRATE[@]}" ]]; then
echo "Migrating database"
glance-manage db migrate
fi
if [[ "${!GLANCE_DB_CONTRACT[@]}" ]]; then
echo "Contracting database"
glance-manage db contract
fi
exit 0
fi

View File

@ -0,0 +1,5 @@
---
features:
- |
Implement Glance zero-downtime upgrade logic.