New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCOW: pass command arguments without extra quoting #33815

Merged
merged 1 commit into from Jun 27, 2017

Conversation

Projects
None yet
5 participants
@jstarks
Contributor

jstarks commented Jun 24, 2017

Right now, LCOW processes do not work with arguments that need to be quoted. E.g. this does not work:

docker run busybox sh -c "echo hello world"

because it ends up double-quoting "echo hello world", so sh tries to find a binary with that name.

This change fixes this by removing the extra quoting for LCOW processes and passing the argument list to hcsshim as a JSON array instead of a single string, which is the more natural interface for Linux processes.

Signed-off-by: John Starks jostarks@microsoft.com

LCOW: pass command arguments without extra quoting
Signed-off-by: John Starks <jostarks@microsoft.com>
@jstarks

This comment has been minimized.

Show comment
Hide comment
@jstarks

jstarks Jun 24, 2017

Contributor
Contributor

jstarks commented Jun 24, 2017

@johnstep

I guess CommandLine and CommandArgs are mutually exclusive? Does HCS just know which one to use, depending on the platform?

@johnstep

LGTM

@jhowardmsft

LGTM.

@jhowardmsft

This comment has been minimized.

Show comment
Hide comment
@jhowardmsft

jhowardmsft Jun 25, 2017

Contributor

Restarted janky

Contributor

jhowardmsft commented Jun 25, 2017

Restarted janky

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Jun 26, 2017

Member

docker-py failing, but I've seen it fail on other PR's; definitely something flaky in there;

23:25:35 =================================== FAILURES ===================================
23:25:35 _________________ ServiceTest.test_create_service_with_secret __________________
23:25:35 /docker-py/tests/integration/api_service_test.py:429: in test_create_service_with_secret
23:25:35     container = self.get_service_container(name)
23:25:35 /docker-py/tests/integration/api_service_test.py:41: in get_service_container
23:25:35     all=include_stopped
23:25:35 /docker-py/docker/api/container.py:189: in containers
23:25:35     res = self._result(self._get(u, params=params), True)
23:25:35 /docker-py/docker/utils/decorators.py:46: in inner
23:25:35     return f(self, *args, **kwargs)
23:25:35 /docker-py/docker/api/client.py:183: in _get
23:25:35     return self.get(url, **self._set_request_timeout(kwargs))
23:25:35 /usr/lib/python2.7/dist-packages/requests/sessions.py:469: in get
23:25:35     return self.request('GET', url, **kwargs)
23:25:35 /usr/lib/python2.7/dist-packages/requests/sessions.py:457: in request
23:25:35     resp = self.send(prep, **send_kwargs)
23:25:35 /usr/lib/python2.7/dist-packages/requests/sessions.py:569: in send
23:25:35     r = adapter.send(request, **kwargs)
23:25:35 /usr/lib/python2.7/dist-packages/requests/adapters.py:407: in send
23:25:35     raise ConnectionError(err, request=request)
23:25:35 E   ConnectionError: ('Connection aborted.', BadStatusLine("''",))
Member

thaJeztah commented Jun 26, 2017

docker-py failing, but I've seen it fail on other PR's; definitely something flaky in there;

23:25:35 =================================== FAILURES ===================================
23:25:35 _________________ ServiceTest.test_create_service_with_secret __________________
23:25:35 /docker-py/tests/integration/api_service_test.py:429: in test_create_service_with_secret
23:25:35     container = self.get_service_container(name)
23:25:35 /docker-py/tests/integration/api_service_test.py:41: in get_service_container
23:25:35     all=include_stopped
23:25:35 /docker-py/docker/api/container.py:189: in containers
23:25:35     res = self._result(self._get(u, params=params), True)
23:25:35 /docker-py/docker/utils/decorators.py:46: in inner
23:25:35     return f(self, *args, **kwargs)
23:25:35 /docker-py/docker/api/client.py:183: in _get
23:25:35     return self.get(url, **self._set_request_timeout(kwargs))
23:25:35 /usr/lib/python2.7/dist-packages/requests/sessions.py:469: in get
23:25:35     return self.request('GET', url, **kwargs)
23:25:35 /usr/lib/python2.7/dist-packages/requests/sessions.py:457: in request
23:25:35     resp = self.send(prep, **send_kwargs)
23:25:35 /usr/lib/python2.7/dist-packages/requests/sessions.py:569: in send
23:25:35     r = adapter.send(request, **kwargs)
23:25:35 /usr/lib/python2.7/dist-packages/requests/adapters.py:407: in send
23:25:35     raise ConnectionError(err, request=request)
23:25:35 E   ConnectionError: ('Connection aborted.', BadStatusLine("''",))
@jhowardmsft

This comment has been minimized.

Show comment
Hide comment
@jhowardmsft

jhowardmsft Jun 26, 2017

Contributor

@shin- ^^ Is there something up with docker-py again? Thanks.

Contributor

jhowardmsft commented Jun 26, 2017

@shin- ^^ Is there something up with docker-py again? Thanks.

@johnstep johnstep merged commit bcc8b2b into moby:master Jun 27, 2017

6 checks passed

dco-signed All commits are signed
experimental Jenkins build Docker-PRs-experimental 35272 has succeeded
Details
janky Jenkins build Docker-PRs 43908 has succeeded
Details
powerpc Jenkins build Docker-PRs-powerpc 4248 has succeeded
Details
windowsRS1 Jenkins build Docker-PRs-WoW-RS1 15223 has succeeded
Details
z Jenkins build Docker-PRs-s390x 3973 has succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment