summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-06-22 04:40:27 +0000
committerGerrit Code Review <review@openstack.org>2021-06-22 04:40:27 +0000
commit9420be480b6165dab67fe06bdc6e796ecc1efb90 (patch)
tree32f51f9c23c9fd3e698ed4c76614273f2186c464
parentc7bbcf43d272a328a9ad685918375a3c2049a0ad (diff)
parent8849cedaf70a5d76367e8f53985f536bbbe3b58e (diff)
downloadtrove-9420be480b6165dab67fe06bdc6e796ecc1efb90.tar.gz
Merge "Fix backup using customized container image registry" into stable/wallaby
-rw-r--r--releasenotes/notes/xena-fix-backup-custom-image-registry.yaml4
-rw-r--r--trove/guestagent/datastore/mysql/service.py2
-rw-r--r--trove/guestagent/utils/docker.py5
3 files changed, 10 insertions, 1 deletions
diff --git a/releasenotes/notes/xena-fix-backup-custom-image-registry.yaml b/releasenotes/notes/xena-fix-backup-custom-image-registry.yaml
new file mode 100644
index 00000000..d940c4e2
--- /dev/null
+++ b/releasenotes/notes/xena-fix-backup-custom-image-registry.yaml
@@ -0,0 +1,4 @@
+---
+fixes:
+ - Fixed backup creation failed issue when using custom container image
+ registry.
diff --git a/trove/guestagent/datastore/mysql/service.py b/trove/guestagent/datastore/mysql/service.py
index 810e17ae..78a371cd 100644
--- a/trove/guestagent/datastore/mysql/service.py
+++ b/trove/guestagent/datastore/mysql/service.py
@@ -67,7 +67,7 @@ class MySqlApp(service.BaseMySqlApp):
to openstacktrove/db-backup-mysql5.7:1.0.0
"""
image = cfg.get_configuration_property('backup_docker_image')
- name, tag = image.split(':', 1)
+ name, tag = image.rsplit(':', 1)
# Get minor version
cur_ver = semantic_version.Version.coerce(CONF.datastore_version)
diff --git a/trove/guestagent/utils/docker.py b/trove/guestagent/utils/docker.py
index 0fdda049..0f254aa6 100644
--- a/trove/guestagent/utils/docker.py
+++ b/trove/guestagent/utils/docker.py
@@ -91,11 +91,16 @@ def run_container(client, image, name, network_mode="host", volumes={},
"""
try:
container = client.containers.get(name)
+ LOG.debug(f'Removing existing container {name}')
container.remove(force=True)
except docker.errors.NotFound:
pass
try:
+ LOG.info(
+ f'Running container {name}, image: {image}, '
+ f'network_mode: {network_mode}, volumes: {volumes}, '
+ f'command: {command}')
output = client.containers.run(
image,
name=name,