Fix backup using customized container image registry
Change-Id: Ib35743e1c315bb7fd4d0fbd99eaa409a4bf5c792 Story: 2008996 Task: 42658
This commit is contained in:
parent
189d3493a8
commit
6d2ab68a8a
@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- Fixed backup creation failed issue when using custom container image
|
||||
registry.
|
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user