summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trove/common/cfg.py2
-rw-r--r--trove/instance/models.py14
2 files changed, 16 insertions, 0 deletions
diff --git a/trove/common/cfg.py b/trove/common/cfg.py
index 65c030cf..e7d08073 100644
--- a/trove/common/cfg.py
+++ b/trove/common/cfg.py
@@ -441,6 +441,8 @@ common_opts = [
help='Extension for default datastore managers. '
'Allows the use of custom managers for each of '
'the datastores supported by Trove.'),
+ cfg.StrOpt('docker_bridge_network_ip', default=None,
+ help='Docker bridge network IP.'),
cfg.StrOpt('template_path', default='/etc/trove/templates/',
help='Path which leads to datastore templates.'),
cfg.BoolOpt('sql_query_logging', default=False,
diff --git a/trove/instance/models.py b/trove/instance/models.py
index 4691b6b9..fe424bc8 100644
--- a/trove/instance/models.py
+++ b/trove/instance/models.py
@@ -1030,6 +1030,20 @@ class BaseInstance(SimpleInstance):
f"CONTROLLER={CONF.controller_address}"
)
+ # Since Victoria, guest agent uses docker.
+ # Configure docker's daemon.json if the directives exist in trove.conf
+ docker_daemon_values = {}
+
+ # Configure docker_bridge_network_ip in order to change the docker
+ # default range(172.17.0.0/16) of bridge network
+ if CONF.docker_bridge_network_ip:
+ docker_daemon_values["bip"] = CONF.docker_bridge_network_ip
+
+ if docker_daemon_values:
+ files['/etc/docker/daemon.json'] = (
+ json.dumps(docker_daemon_values)
+ )
+
return files
def reset_status(self):