Set swarm api_address protocol to tcp on all cases.

The docker command line client does not allow https as protocol in the
DOCKER_HOST string. Set protocol in the api_address field in the bay to
tcp in all cases for compatibility (works also for TLS enabled bays).

This is also compatible with the python docker client (docker-py).

Change-Id: I7ef4e2d154c6ad682d4124f7a3adbfeef4e91e0c
Closes-Bug: #1604812
This commit is contained in:
Ricardo Rocha 2016-07-20 15:19:46 +02:00
parent 9fe2e77bb0
commit 9c093da955
2 changed files with 4 additions and 6 deletions

View File

@ -28,12 +28,10 @@ class SwarmApiAddressOutputMapping(template_def.OutputMapping):
output_value = self.get_output_value(stack)
if output_value is not None:
protocol = 'https'
if baymodel.tls_disabled:
protocol = 'tcp'
# Note(rocha): protocol should always be tcp as the docker
# command client does not handle https (see bug #1604812).
params = {
'protocol': protocol,
'protocol': 'tcp',
'address': output_value,
'port': DOCKER_PORT,
}

View File

@ -433,7 +433,7 @@ class AtomicK8sTemplateDefinitionTestCase(base.TestCase):
def test_update_swarm_outputs_if_baymodel_is_secure(self):
address = 'updated_address'
protocol = 'https'
protocol = 'tcp'
port = '2376'
params = {
'protocol': protocol,