Revert "docker/compose: quote health-cmd"

This reverts commit 9fbbad559d.
This patch was wrong. We don't need the quotes because
we use subprocess and the args aren't parsed lie on
bash.

Change-Id: I975a5de297e07eb701e2b9c72495e63daa3cbc41
Related-Bug: #1824808
This commit is contained in:
Emilien Macchi 2019-06-13 22:00:50 +00:00 committed by Alex Schultz
parent 41c85bdef3
commit 78f61f9c9c
2 changed files with 3 additions and 3 deletions

View File

@ -186,7 +186,7 @@ class ComposeV1Builder(object):
if 'healthcheck' in cconfig: if 'healthcheck' in cconfig:
hconfig = cconfig['healthcheck'] hconfig = cconfig['healthcheck']
if 'test' in hconfig: if 'test' in hconfig:
cmd.append('--health-cmd="%s"' % hconfig['test']) cmd.append('--health-cmd=%s' % hconfig['test'])
if 'interval' in hconfig: if 'interval' in hconfig:
cmd.append('--health-interval=%s' % hconfig['interval']) cmd.append('--health-interval=%s' % hconfig['interval'])
if 'timeout' in hconfig: if 'timeout' in hconfig:

View File

@ -424,7 +424,7 @@ three-12345678 three''', '', 0),
'uts': 'host', 'uts': 'host',
'restart': 'always', 'restart': 'always',
'healthcheck': { 'healthcheck': {
'test': 'ls /mydir', 'test': '/bin/true',
'interval': '30s', 'interval': '30s',
'timeout': '10s', 'timeout': '10s',
'retries': 3 'retries': 3
@ -443,7 +443,7 @@ three-12345678 three''', '', 0),
['docker', 'run', '--name', 'one', ['docker', 'run', '--name', 'one',
'--detach=true', '--env-file=/tmp/foo.env', '--detach=true', '--env-file=/tmp/foo.env',
'--net=host', '--ipc=host', '--pid=container:bar', '--net=host', '--ipc=host', '--pid=container:bar',
'--uts=host', '--health-cmd="ls /mydir"', '--health-interval=30s', '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s',
'--health-timeout=10s', '--health-retries=3', '--health-timeout=10s', '--health-retries=3',
'--privileged=true', '--restart=always', '--user=bar', '--privileged=true', '--restart=always', '--user=bar',
'--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}', '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}',