Commit Graph

2721 Commits

Author SHA1 Message Date
Joffrey F bc5d7c8cb6 Modernize auth management
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 19:32:01 -08:00
Joffrey F 9a67e2032e Next dev version
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 14:31:28 -08:00
Joffrey F 80e862aafa Merge branch 'release' 2018-11-28 14:30:06 -08:00
Joffrey F d74bfa69ab
Merge pull request #2187 from docker/3.6.0-release
3.6.0 release
2018-11-28 12:11:38 -08:00
Joffrey F 24ed2f356b Release 3.6.0
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:57:19 -08:00
Joffrey F 30d16ce89a 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:56:28 -08:00
adw1n 7117855f6e 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:56:28 -08:00
Joffrey F f9505da1d6 Correctly handle longpath prefix in process_dockerfile when joining paths
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Corentin Henry 2d5a7c3894 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-28 11:56:28 -08:00
Corentin Henry ad4f5f9d0c tests: fix failure due to pytest deprecation
Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
2018-11-28 11:56:28 -08:00
Joffrey F cafb802c51 Fix versions script to accept versions without -ce suffix
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F e6889eb9d6 Fix file mode in image.save examples
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F 584204bbdd Add doc example for get_archive
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F 66666f9824 Properly convert non-string filters to expected string format
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
Joffrey F d9e08aedc3 Disallow incompatible combination stats(decode=True, stream=False)
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-28 11:56:28 -08:00
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
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
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