Support --image-tags for trove-manager datastore_version_update command
image-tags was introduced in commit 1d24b65
but the implementation was
backward incompatible for the CLI `trove-manager datastore_version_update`.
This patch changes that by supporting an optional parameter `--image-tags`.
Change-Id: I583c296f15a453bdfadf10de5c678ac483cbd4dd
This commit is contained in:
parent
3a3b82452d
commit
da2da6969a
@ -485,7 +485,7 @@ function create_guest_image {
|
|||||||
|
|
||||||
echo "Register the image in datastore"
|
echo "Register the image in datastore"
|
||||||
$TROVE_MANAGE datastore_update $TROVE_DATASTORE_TYPE ""
|
$TROVE_MANAGE datastore_update $TROVE_DATASTORE_TYPE ""
|
||||||
$TROVE_MANAGE datastore_version_update $TROVE_DATASTORE_TYPE $TROVE_DATASTORE_VERSION $TROVE_DATASTORE_TYPE "" "trove" "" 1
|
$TROVE_MANAGE datastore_version_update $TROVE_DATASTORE_TYPE $TROVE_DATASTORE_VERSION $TROVE_DATASTORE_TYPE "" "" 1 --image-tags trove
|
||||||
$TROVE_MANAGE datastore_update $TROVE_DATASTORE_TYPE $TROVE_DATASTORE_VERSION
|
$TROVE_MANAGE datastore_update $TROVE_DATASTORE_TYPE $TROVE_DATASTORE_VERSION
|
||||||
|
|
||||||
echo "Add parameter validation rules if available"
|
echo "Add parameter validation rules if available"
|
||||||
|
@ -157,7 +157,7 @@ Upgrade Trove services
|
|||||||
--property hw_rng_model='virtio' \
|
--property hw_rng_model='virtio' \
|
||||||
--tag trove \
|
--tag trove \
|
||||||
-c id -f value)
|
-c id -f value)
|
||||||
$ trove-manage datastore_version_update mysql 5.7.29 mysql $imageid "" "" 1
|
$ trove-manage datastore_version_update mysql 5.7.29 mysql $imageid "" 1
|
||||||
$ trove-manage db_load_datastore_config_parameters mysql 5.7.29 $stackdir/trove/trove/templates/mysql/validation-rules.json
|
$ trove-manage db_load_datastore_config_parameters mysql 5.7.29 $stackdir/trove/trove/templates/mysql/validation-rules.json
|
||||||
|
|
||||||
Upgrade Trove guest agent
|
Upgrade Trove guest agent
|
||||||
|
@ -200,7 +200,8 @@ trove-manage datastore_version_update
|
|||||||
|
|
||||||
usage: trove-manage datastore_version_update [-h]
|
usage: trove-manage datastore_version_update [-h]
|
||||||
datastore version_name manager
|
datastore version_name manager
|
||||||
image_id image_tags packages active
|
image_id packages active
|
||||||
|
--image-tags <image_tags>
|
||||||
|
|
||||||
Add or update a datastore version. If the datastore version already exists,
|
Add or update a datastore version. If the datastore version already exists,
|
||||||
all values except the datastore name and version will be updated.
|
all values except the datastore name and version will be updated.
|
||||||
@ -219,13 +220,6 @@ all values except the datastore name and version will be updated.
|
|||||||
``image_id``
|
``image_id``
|
||||||
ID of the image used to create an instance of the datastore version.
|
ID of the image used to create an instance of the datastore version.
|
||||||
|
|
||||||
``image_tags``
|
|
||||||
List of image tags separated by comma. If the image ID is not provided
|
|
||||||
explicitly, the image can be retrieved by the image tags. Multiple image tags
|
|
||||||
are separated by comma, e.g. trove,mysql. Using image tags is more flexible
|
|
||||||
than ID especially when new guest image is uploaded to Glance, Trove can pick
|
|
||||||
up the latest image automatically for creating instances.
|
|
||||||
|
|
||||||
``packages``
|
``packages``
|
||||||
Packages required by the datastore version that are installed on
|
Packages required by the datastore version that are installed on
|
||||||
the guest image.
|
the guest image.
|
||||||
@ -239,6 +233,13 @@ all values except the datastore name and version will be updated.
|
|||||||
``-h, --help``
|
``-h, --help``
|
||||||
show this help message and exit
|
show this help message and exit
|
||||||
|
|
||||||
|
``--image-tags``
|
||||||
|
List of image tags separated by comma. If the image ID is not provided
|
||||||
|
explicitly, the image can be retrieved by the image tags. Multiple image tags
|
||||||
|
are separated by comma, e.g. trove,mysql. Using image tags is more flexible
|
||||||
|
than ID especially when new guest image is uploaded to Glance, Trove can pick
|
||||||
|
up the latest image automatically for creating instances.
|
||||||
|
|
||||||
trove-manage db_downgrade
|
trove-manage db_downgrade
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -522,7 +522,8 @@ function set_bin_path() {
|
|||||||
|
|
||||||
function cmd_set_datastore() {
|
function cmd_set_datastore() {
|
||||||
rd_manage datastore_update "$datastore" ""
|
rd_manage datastore_update "$datastore" ""
|
||||||
rd_manage datastore_version_update "${DATASTORE_TYPE}" "${DATASTORE_VERSION}" "${DATASTORE_TYPE}" "" "trove" "" 1
|
# Use image tags for datastore version.
|
||||||
|
rd_manage datastore_version_update "${DATASTORE_TYPE}" "${DATASTORE_VERSION}" "${DATASTORE_TYPE}" "" "" 1 --image-tags trove
|
||||||
rd_manage datastore_update "${DATASTORE_TYPE}" "${DATASTORE_VERSION}"
|
rd_manage datastore_update "${DATASTORE_TYPE}" "${DATASTORE_VERSION}"
|
||||||
|
|
||||||
if [[ -f "$PATH_TROVE"/trove/templates/${DATASTORE_TYPE}/validation-rules.json ]]; then
|
if [[ -f "$PATH_TROVE"/trove/templates/${DATASTORE_TYPE}/validation-rules.json ]]; then
|
||||||
|
@ -62,7 +62,7 @@ class Commands(object):
|
|||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
def datastore_version_update(self, datastore, version_name, manager,
|
def datastore_version_update(self, datastore, version_name, manager,
|
||||||
image_id, image_tags, packages, active,
|
image_id, packages, active, image_tags=None,
|
||||||
version=None):
|
version=None):
|
||||||
try:
|
try:
|
||||||
datastore_models.update_datastore_version(datastore,
|
datastore_models.update_datastore_version(datastore,
|
||||||
@ -251,10 +251,6 @@ def main():
|
|||||||
'image_id',
|
'image_id',
|
||||||
help='ID of the image used to create an instance of '
|
help='ID of the image used to create an instance of '
|
||||||
'the datastore version.')
|
'the datastore version.')
|
||||||
parser.add_argument(
|
|
||||||
'image_tags',
|
|
||||||
help='List of image tags separated by comma used for getting '
|
|
||||||
'guest image.')
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'packages', help='Packages required by the datastore version that '
|
'packages', help='Packages required by the datastore version that '
|
||||||
'are installed on the guest image.')
|
'are installed on the guest image.')
|
||||||
@ -262,6 +258,10 @@ def main():
|
|||||||
'active', type=int,
|
'active', type=int,
|
||||||
help='Whether the datastore version is active or not. '
|
help='Whether the datastore version is active or not. '
|
||||||
'Accepted values are 0 and 1.')
|
'Accepted values are 0 and 1.')
|
||||||
|
parser.add_argument(
|
||||||
|
'--image-tags',
|
||||||
|
help='List of image tags separated by comma used for getting '
|
||||||
|
'guest image.')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--version',
|
'--version',
|
||||||
help='The version number of the datastore version, e.g. 5.7.30. '
|
help='The version number of the datastore version, e.g. 5.7.30. '
|
||||||
|
Loading…
Reference in New Issue
Block a user