Browse Source

Change network_mode default to host

Kolla-Ansible deploys Docker without bridge by default [1].

[1]: https://review.opendev.org/c/openstack/kolla-ansible/+/751795

Change-Id: I7430b72f5d8abe59a7151df73e6d59898d942636
(cherry picked from commit d7252ba582)
changes/95/795795/1
Michał Nasiadka 2 weeks ago
committed by Radosław Piliszek
parent
commit
f9f2f12cc9
3 changed files with 17 additions and 11 deletions
  1. +1
    -1
      kolla/common/config.py
  2. +10
    -10
      kolla/tests/test_build.py
  3. +6
    -0
      releasenotes/notes/network-mode-host-2aca256e2a1fbf68.yaml

+ 1
- 1
kolla/common/config.py View File

@ -174,7 +174,7 @@ _CLI_OPTS = [
help='Show all available images (filtering supported)'),
cfg.StrOpt('namespace', short='n', default='kolla',
help='The Docker namespace name'),
cfg.StrOpt('network_mode', default=None,
cfg.StrOpt('network_mode', default='host',
help='The network mode for Docker build. Example: host'),
cfg.BoolOpt('cache', default=True,
help='Use the Docker cache when building'),


+ 10
- 10
kolla/tests/test_build.py View File

@ -166,8 +166,8 @@ class TasksTest(base.TestCase):
mock_client().build.assert_called_once_with(
path=self.image.path, tag=self.image.canonical_name, decode=True,
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
buildargs=None)
network_mode='host', nocache=False, rm=True, pull=True,
forcerm=True, buildargs=None)
self.assertTrue(builder.success)
@ -176,14 +176,14 @@ class TasksTest(base.TestCase):
def test_build_image_with_network_mode(self, mock_client):
self.dc = mock_client
push_queue = mock.Mock()
self.conf.set_override('network_mode', 'host')
self.conf.set_override('network_mode', 'bridge')
builder = build.BuildTask(self.conf, self.image, push_queue)
builder.run()
mock_client().build.assert_called_once_with(
path=self.image.path, tag=self.image.canonical_name, decode=True,
network_mode='host', nocache=False, rm=True, pull=True,
network_mode='bridge', nocache=False, rm=True, pull=True,
forcerm=True, buildargs=None)
self.assertTrue(builder.success)
@ -203,8 +203,8 @@ class TasksTest(base.TestCase):
mock_client().build.assert_called_once_with(
path=self.image.path, tag=self.image.canonical_name, decode=True,
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
buildargs=build_args)
network_mode='host', nocache=False, rm=True, pull=True,
forcerm=True, buildargs=build_args)
self.assertTrue(builder.success)
@ -222,8 +222,8 @@ class TasksTest(base.TestCase):
mock_client().build.assert_called_once_with(
path=self.image.path, tag=self.image.canonical_name, decode=True,
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
buildargs=build_args)
network_mode='host', nocache=False, rm=True, pull=True,
forcerm=True, buildargs=build_args)
self.assertTrue(builder.success)
@ -243,8 +243,8 @@ class TasksTest(base.TestCase):
mock_client().build.assert_called_once_with(
path=self.image.path, tag=self.image.canonical_name, decode=True,
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
buildargs=build_args)
network_mode='host', nocache=False, rm=True, pull=True,
forcerm=True, buildargs=build_args)
self.assertTrue(builder.success)


+ 6
- 0
releasenotes/notes/network-mode-host-2aca256e2a1fbf68.yaml View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Changed default of ``network_mode`` to ``host`` since Kolla-Ansible
``bootstrap-servers`` is deploying Docker without a bridge by default
since `Wallaby <https://review.opendev.org/c/openstack/kolla-ansible/+/751795>`__

Loading…
Cancel
Save