Commit Graph

3158 Commits

Author SHA1 Message Date
Joffrey F ebfba8d4c3 Fix incorrect return info for inspect_service
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F bc45e71c55 Document attr caching for Container objects
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F d4b1c259a2 Update links docs and fix bug in normalize_links
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F 049e7e16d4 Improved LogConfig documentation
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F 9467fa4809 Improve ulimits documentation
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F f1d629fb5c Add named parameter to image.save to identify which repository name to use in the resulting tarball
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Adam Dangoor 8f3dc4740e Add a missing space in a log message
Signed-off-by: Adam Dangoor <adamdangoor@gmail.com>
2018-11-28 11:56:08 -08:00
Joffrey F 3d5313a5fd Rewrite utils.parse_host to detect more invalid addresses.
The method now uses parsing methods from urllib to better split provided URLs.
Addresses containing query strings, parameters, passwords or fragments no longer fail silently.
SSH addresses containing paths are no longer accepted.

Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 6777c28dee Clear error for cancellable streams over SSH
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 8c86aa90b1 Update tests to properly dispose of client instances in tearDown
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F c9edc9c748 Update tests for ssh protocol compatibility
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 2b2d711a5b Remove misleading fileno method from NpipeSocket class
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 956474a1bf Add support for SSH protocol in base_url
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F e4368fb0f3 Add paramiko requirement for SSH transport
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 2e4a45358e Update version detection script for CI
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 26daa6194a Add xfail to ignore 18.09 beta bug
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F a422924a5e Bump requests dependency in requirements.txt (CVE-2018-18074)
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:08 -08:00
Joffrey F 042a0e5474
Merge pull request #2186 from docker/adw1n-i2116
Fix pulling images with `stream=True`
2018-11-28 11:45:52 -08:00
Joffrey F c53423f118 Update DockerClient.images.pull to always stream response
Also raise a warning when users attempt to specify the "stream" parameter

Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:27:04 -08:00
adw1n a74d546864 Fix pulling images with `stream=True`
Pulling an image with option `stream=True` like this:
```
client.api.pull('docker.io/user/repo_name', tag='latest', stream=True)
```
without consuming the generator oftentimes results in premature drop of the connection. Docker daemon tries to send progress of pulling the image to the client, but it encounters an error (broken pipe) and therefore cancells the pull action:
```
Thread 1 "dockerd-dev" received signal SIGPIPE, Broken pipe.
ERRO[2018-09-03T05:12:35.746497638+02:00] Not continuing with pull after error: context canceled
```
As described in issue #2116, even though client receives response with status code 200, image is not pulled.

Closes #2116

Signed-off-by: Przemysław Adamek <adw1n@users.noreply.github.com>
2018-11-28 11:27:04 -08:00
Corentin Henry 5f157bbaca implement stream demultiplexing for exec commands
fixes https://github.com/docker/docker-py/issues/1952

Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
2018-11-27 17:01:48 -08:00
Joffrey F e1e4048753
Merge pull request #2183 from docker/c6356-longpath-prefix
Correctly handle longpath prefix in process_dockerfile when joining paths
2018-11-26 17:45:48 -08:00
Joffrey F 114630161a Correctly handle longpath prefix in process_dockerfile when joining paths
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-26 17:34:26 -08:00
Joffrey F f3231a1ebb
Merge pull request #2178 from little-dude/fix_deprecation
tests: fix failure due to pytest deprecation
2018-11-26 16:39:12 -08:00
Frank Sachsenheim 3fca75ffef
Fixes return value models.containers.Container.exec_run.__doc__
Signed-off-by: Frank Sachsenheim <funkyfuture@riseup.net>
2018-11-27 01:06:02 +01:00
Corentin Henry 493d7f0f30 tests: bump pytest-timeout
Signed-off-by: Corentin Henry <corentinhenry@gmail.com>

pytest-timeout 1.2.1 seems to be incompatible with pytest 3.6.3:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/main.py", line 185, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/main.py", line 225, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/main.py", line 246, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 182, in _multicall
INTERNALERROR>     next(gen)  # first yield
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 76, in pytest_runtest_protocol
INTERNALERROR>     timeout_setup(item)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 104, in timeout_setup
INTERNALERROR>     timeout, method = get_params(item)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 162, in get_params
INTERNALERROR>     timeout, method = _parse_marker(item.keywords['timeout'])
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 178, in _parse_marker
INTERNALERROR>     if not marker.args and not marker.kwargs:
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/mark/structures.py", line 25, in warned
INTERNALERROR>     warnings.warn(warning, stacklevel=2)
INTERNALERROR> RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
INTERNALERROR> Please use node.get_closest_marker(name) or node.iter_markers(name).
INTERNALERROR> Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
2018-11-21 18:29:02 -08:00
Corentin Henry 47c10aa383 tests: fix failure due to pytest deprecation
Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
2018-11-21 17:17:50 -08:00
Joffrey F f7a1052b2b Fix versions script to accept versions without -ce suffix
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 18:58:06 -08:00
Joffrey F 302cb78f87
Merge pull request #2172 from docker/fix_docs
Documentation fixes
2018-11-08 18:10:09 -08:00
Joffrey F 35b9460748 Remove prematurely committed file
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:38:59 -08:00
Joffrey F 852d79b08d Fix file mode in image.save examples
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:32:33 -08:00
Joffrey F cebdee4aef Add doc example for get_archive
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:31:22 -08:00
Joffrey F f83fe7c959 Properly convert non-string filters to expected string format
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:22:24 -08:00
Joffrey F 89ee08f511 Disallow incompatible combination stats(decode=True, stream=False)
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:13:19 -08:00
Joffrey F b927a5f62c Fix incorrect return info for inspect_service
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:08:41 -08:00
Joffrey F 6bfe4c9090 Document attr caching for Container objects
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 17:05:42 -08:00
Joffrey F 6064947431 Update links docs and fix bug in normalize_links
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 16:55:58 -08:00
Joffrey F d5bc46ad45 Improved LogConfig documentation
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 16:20:28 -08:00
Joffrey F 1d124a1262 Improve ulimits documentation
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 15:32:10 -08:00
Joffrey F 9987c1bc42 Fix docs examples to work with Python 3
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-08 15:05:22 -08:00
Joffrey F 5467658bbc
Merge pull request #2169 from docker/2124-image-save-with-name
Add named parameter to image.save to identify which repository name to use in the resulting tarball
2018-11-08 12:50:03 -08:00
Joffrey F e237c0ea16 Add named parameter to image.save to identify which repository name to use in the resulting tarball
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-06 14:46:37 -08:00
Joffrey F 7252086054
Merge pull request #2165 from docker/ssh_protocol_support
SSH protocol support
2018-11-06 11:09:00 -08:00
Joffrey F c9bee7716f
Merge pull request #2168 from adamtheturtle/patch-1
Add a missing space in a log message
2018-11-04 22:57:57 -08:00
Adam Dangoor 490b2db3ae Add a missing space in a log message
Signed-off-by: Adam Dangoor <adamdangoor@gmail.com>
2018-11-05 00:11:59 +00:00
Joffrey F f302756599 Rewrite utils.parse_host to detect more invalid addresses.
The method now uses parsing methods from urllib to better split provided URLs.
Addresses containing query strings, parameters, passwords or fragments no longer fail silently.
SSH addresses containing paths are no longer accepted.

Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:44:43 -07:00
Joffrey F 6bfe2005e0 Clear error for cancellable streams over SSH
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:24:22 -07:00
Joffrey F 94aa9a89f7 Update tests to properly dispose of client instances in tearDown
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:24:22 -07:00
Joffrey F 1df021ee24 Update tests for ssh protocol compatibility
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:24:22 -07:00
Joffrey F f4e9a1dc2a Remove misleading fileno method from NpipeSocket class
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:24:22 -07:00