Skip to content

Commit

Permalink
revert #2039
Browse files Browse the repository at this point in the history
PR 2039 broke dockerlatent start
  • Loading branch information
Pierre Tardy committed Jun 27, 2016
1 parent 420cba2 commit e232850
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
5 changes: 0 additions & 5 deletions master/buildbot/test/unit/test_worker_docker.py
Expand Up @@ -55,11 +55,6 @@ def test_constructor_image_nodockerfile(self):
self.assertEqual(bs.dockerfile, None)
self.assertEqual(bs.image, 'myworker')

def test_constructor_networking_config(self):
bs = self.ConcreteWorker(
'bot', 'pass', 'http://localhost:2375', 'worker', networking_config='host')
self.assertEqual(bs.networking_config, 'host')

def test_constructor_minimal(self):
# Minimal set of parameters
bs = self.ConcreteWorker('bot', 'pass', 'tcp://1234:2375', 'worker')
Expand Down
6 changes: 2 additions & 4 deletions master/buildbot/worker/docker.py
Expand Up @@ -59,7 +59,7 @@ class DockerLatentWorker(AbstractLatentWorker):

def __init__(self, name, password, docker_host, image=None, command=None,
volumes=None, dockerfile=None, version=None, tls=None, followStartupLogs=False,
masterFQDN=None, hostconfig=None, networking_config='bridge', **kwargs):
masterFQDN=None, hostconfig=None, **kwargs):

if not client:
config.error("The python module 'docker-py>=1.4' is needed to use a"
Expand All @@ -70,7 +70,6 @@ def __init__(self, name, password, docker_host, image=None, command=None,

self.volumes = volumes or []
self.binds = {}
self.networking_config = networking_config
self.followStartupLogs = followStartupLogs

# Following block is only for checking config errors,
Expand Down Expand Up @@ -185,8 +184,7 @@ def _thd_start_instance(self, image, volumes):
name='%s_%s' % (self.workername, id(self)),
volumes=self.volumes,
environment=self.createEnvironment(),
host_config=host_conf,
networking_config=self.networking_config
host_config=host_conf
)

if instance.get('Id') is None:
Expand Down
5 changes: 1 addition & 4 deletions master/docs/manual/cfg-workers-docker.rst
Expand Up @@ -186,7 +186,7 @@ In addition to the arguments available for any :ref:`Latent-Workers`, :class:`Do
(optional if ``dockerfile`` is given)
This is the name of the image that will be started by the build master. It should start a worker.
This option can be a renderable, like :ref:`Interpolate`, so that it generates from the build request properties.

``command``
(optional)
This will override the command setup during image creation.
Expand Down Expand Up @@ -225,9 +225,6 @@ In addition to the arguments available for any :ref:`Latent-Workers`, :class:`Do
(optional)
Extra host configuration parameters passed as a dictionary used to create HostConfig object. See `docker-py's HostConfig documentation <https://docker-py.readthedocs.io/en/latest/hostconfig/>`_ for all the supported options.

``networking_config``
Set the network configuration for the docker container. It can be one the following: 'bridge', 'host', container:<NAME or ID>, none. The default is bridge. This option is equivalent to using the ``--net=`` command line parameter in docker.

Setting up Volumes
..................

Expand Down

0 comments on commit e232850

Please sign in to comment.