Commit Graph

283 Commits

Author SHA1 Message Date
49adb54d71 Remove duplicate calls for getting an APIClient
Remove request.SockRequest
Remove request.SockRequestHijack
Remove request.SockRequestRaw()
Remove deprecated ParseHost
Deprecate and unexport more helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4
Component: engine
2018-02-20 17:27:24 -05:00
180ce35066 Improve docstrings and small cleanup in client
Use client instead of helpers for TLS in integration test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a68ae4a2d95b1ff143025a435195af0f1ab30ace
Component: engine
2018-02-20 15:15:02 -05:00
9a83d9fd53 Use gotestyourself env patching
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 2b445a53c17ae6526c11a729cb6d1d1dc57490ff
Component: engine
2018-02-20 15:15:02 -05:00
fbcb172e80 Merge pull request #36144 from emil2k/node-id-required
Produce errors when empty ids are passed into inspect calls. 
Upstream-commit: db360995df97f9d9bcb4eb6a34a5c35a2711795b
Component: engine
2018-02-16 10:18:47 -08:00
ff398aa5c7 Merge pull request #34900 from dnephin/send-codecov-report
Create and send codecov report
Upstream-commit: 01bfb6d27c6a4b12c777a11c58830a5ef83379a9
Component: engine
2018-02-16 11:36:51 +01:00
d92fe4f6a1 Fix TLS from environment variables in client
A recent change accidently caused any TLS configuration in FromEnv to be
ignored. This change alters WithHost to create a new http client only if
one doesn't already exist, and otherwise applies the logic to the
transport on the existing client. This preserves the TLS configuration
that might already be on the client.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 80904e9571e7724328160c97ede6a71864f3c06a
Component: engine
2018-02-09 15:29:32 -08:00
0590bb4b31 Introduce NewClientWithOpts func to build custom client easily
This allows to create a client with default values and override those
using functors. As an example, `NewEnvClient()` becomes
`NewClientWithOpts(FromEnv)` ; and if you want a different api version
for this client : `NewClientWithOpts(FromEnv, WithVersion("1.35"))`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 772edd020cc784913973387b00c4d0c526a10a26
Component: engine
2018-02-08 15:26:24 +01:00
3122cc53fa Produce errors when empty ids are passed into inspect calls.
If a blank nodeID was previously passed in it resulted in a node list
request. The response would then fail to umarshal into a `Node`
type returning a JSON error.

This adds an extra validation to all inspect calls to check that the ID
that is required is provided and if not return an error.

Signed-off-by: Emil Davtyan <emil2k@gmail.com>
Upstream-commit: 3e6bbefd268f51755be5af0644995297a71a05d7
Component: engine
2018-02-07 14:05:14 +01:00
be83c11fb0 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
Component: engine
2018-02-05 16:51:57 -05:00
96ed38b227 Merge pull request #35979 from emil2k/fix-container-copy-err
Wrap response errors for container copy methods.
Upstream-commit: 1d1845de5464d7ba8e7b735b0d221b1232851ab2
Component: engine
2018-01-25 13:48:49 -08:00
ed76e0e519 Alias container and network packages to stop name clashes
Signed-off-by: Adam Pointer <adam.pointer@gmx.com>
Upstream-commit: 7732ca94fc67a28cbd37c292dc29216255685eba
Component: engine
2018-01-19 10:26:41 +00:00
f088309662 Add code coverage report and codecov config
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e5cce50c7ea727c1c901b6e1443bd4291d62fce3
Component: engine
2018-01-16 16:50:56 -05:00
4f33349d30 Wrap response error for container logs method.
Signed-off-by: Emil Davtyan <emil2k@gmail.com>
Upstream-commit: 2d6fb87ca41c52b255e874be62f2a3c2181a7639
Component: engine
2018-01-12 16:43:51 +01:00
10c2915921 Wrap response errors for container copy methods.
This allows IsErrNotFound and IsErrNotImplemented to work as intended.

Signed-off-by: Emil Davtyan <emil2k@gmail.com>
Upstream-commit: 44369bdd6507006108f39b85b5950f933bf1380a
Component: engine
2018-01-11 13:40:49 +01:00
844b65b181 Update doc for CopyFromContainer
This fix updates doc for CopyFromContainer to explicitly
mention that the content received from the reader is
a TAR archive.

This fix closes 35965.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e330e7a5ce77736c76c36ba77983accfae01c405
Component: engine
2018-01-08 18:29:59 +00:00
5de35938b7 Merge pull request #32914 from jamiehannaford/until-logging
Add --until flag for docker logs; closes #32807
Upstream-commit: 68a4552529c2eafb7093dc2bc25e7fc243bf363f
Component: engine
2017-11-03 16:08:30 +01:00
eefbd135ae Remove solaris build tag and `contrib/mkimage/solaris
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 4785f1a7ab7ec857dc3ca849ee6ecadf519ef30e
Component: engine
2017-11-02 00:01:46 +00:00
fb29de3583 Add --until flag for docker logs; closes #32807
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
Upstream-commit: e8d9a61f4c9e1f3cfdf1c889c541c9dc72a4bb40
Component: engine
2017-11-01 10:08:49 +01:00
4d03b3fd97 Merge pull request #35128 from thaJeztah/fix-ContainerExecAttach-type
Use correct type for ContainerExecAttach
Upstream-commit: 8b24d2a96024d7aa35a26744ea7c7df577accc4b
Component: engine
2017-10-10 10:59:16 -07:00
016304f346 Use correct type for ContainerExecAttach
ContainerExecAttach used `types.ExecConfig` instead of `types.ExecStartCheck`,
which is the type that's expected by the `/exec/execid/start` API endpoint.

Investigating when this inconsistency was introduced, I found that the client has
sent the additional properties since its first imlpementation in
c786a8ee5e9db8f5f609cf8721bd1e1513fb0043.

The `postContainerExecStart()` at that time used the "jobs" package, which
only took the information from the body that was needed (`Detach` and `Tty`).

Commit 24425021d26f29a475702064181e6c99fb6bd1c5 refactored the Exec commands
to remove the "jobs", and introduced the `ExecStartCheck` type, but failed to
update the `cli.hijack()` call with the new type.

The change in this patch should not affect compatibility with older clients,
as the additional information from the `ExecConfig` type is not used (the
API server already decodes to the `ExecStartCheck` type).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5fee8bddfeb9b268f3e0b3c91e0932ee9a5eff83
Component: engine
2017-10-09 01:25:46 +02:00
3d973055bf LCOW: API change JSON header to string POST parameter
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: d98ecf2d6cdad7dae65868398440cfdc855e5263
Component: engine
2017-10-06 15:26:48 -07:00
35db73fa01 LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.
Upstream-commit: 0380fbff37922cadf294851b1546f4c212c7f364
Component: engine
2017-10-06 11:44:18 -07:00
72747182f4 Remove deprecated IsErr...NotFound() functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7553fc4bcd80d103096f2e8f662b7fb3c65b5249
Component: engine
2017-10-03 12:07:49 +02:00
886e433681 Replace uses of deprecated IsErr...Notfound()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 919726b5dbf7f063f82eac2f5384966fc7271710
Component: engine
2017-10-03 12:05:03 +02:00
747a47b477 Fix version comparison when negotiating the the API version
Signed-off-by: Yu-Ju Hong <yjhong@google.com>
Upstream-commit: 4b6ec10b07c14e7fff1cc51156b6d954147f826f
Component: engine
2017-09-27 18:42:02 -07:00
5dbfedf3f9 Replace uses of filters.ToParam(), FromParam() with filters.ToJSON(), FromJSON()
`filters.ToParam()` and `filters.FromParam()` were deprecated in favor of
`filters.ToJSON()` and `filters.FromJSON()` in 065118390a3ecaf0dbd2fa752d54d43f8f1e8ec6,
but still used in various locations.

This patch replaces uses of `filters.ToParam()` and  `filters.FromParam()` with
`filters.ToJSON()` and `filters.FromJSON()`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a4efe66cf2a7648dbcf5b9993bf351925b905b5b
Component: engine
2017-09-26 13:59:45 +02:00
e38ecccceb Match not implemented error check to others
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: 7406088853b6cbcb8996c367062cee2e1ee6eaaa
Component: engine
2017-09-25 13:58:51 +02:00
20c1a2b928 Handle plugin list not implemented
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Upstream-commit: e7e11bdd44878d28c642d72761aa41eb9ffce3d1
Component: engine
2017-09-20 19:48:33 +02:00
93617a3f74 Merge pull request #34784 from dnephin/fix-client-not-found
Cleanup client not found errors
Upstream-commit: bb0e8ee51c8940c3ce23e4f594068612203c6139
Component: engine
2017-09-14 12:04:56 +02:00
18c29c5c5f Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f7f101d57ef8cbf2d8723a18b7d723c5c5dd04b6
Component: engine
2017-09-12 12:09:59 -04:00
ee7b60968b Cleanup client not found errors.
And fix remove calls to return a notFound error

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 81bb9978ab5ac99e84a5bf62d0d469f0aec1d506
Component: engine
2017-09-11 19:53:18 -04:00
2c45bc6a92 Merge pull request #34770 from dnephin/fix-client-with-empty-id
Fix volume inspect with empty ID
Upstream-commit: 63a9ea58eb4c704ed7d7dab950f12f708cf220f7
Component: engine
2017-09-11 07:01:50 -07:00
af0adf66d4 Merge pull request #34790 from dnephin/add-ineffassign-linter
Add ineffassign linter
Upstream-commit: 13fec0607394f7c6da0148f8d513b6fcbf7cce61
Component: engine
2017-09-09 15:41:55 -07:00
fdd3e06a77 Add ineffassign linter
Also enable GC in linting to reduce memory usage.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 09652bf8789142a5a5a1de2d41590300761b4954
Component: engine
2017-09-08 18:23:21 -04:00
5899c64938 Fix volume inspect with empty ID
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5ac298fd0e5c065483653970be587626026971c2
Component: engine
2017-09-07 13:46:23 -04:00
980d05f2ea Cleanup client/ interface
- Remove ParseLogDetails, this is not part of the client. Moved to docker/cli
- Deprecate ParseHost and replace with ParseHostURL
- Deprecate redundant IsErr helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 54242cd067c234960d1295a67271475f9d099f22
Component: engine
2017-09-07 12:32:38 -04:00
6f155f233b Merge pull request #34021 from nishanttotla/dont-set-architecture-constraint
Clear Architecture field in platform constraint for arm architectures
Upstream-commit: ea220e70a13963da544645376cd9331021eec6b4
Component: engine
2017-09-07 11:18:12 +02:00
9f20b18453 Move tlsconfig to client package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6916c215b00ab4d7edf4be14848ab2e695697381
Component: engine
2017-09-06 16:39:55 -04:00
2578773887 Clear Architecture field in platform constraint for arm architectures
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
Upstream-commit: 772af6040ed4f2f26c22901597333a900be17aae
Component: engine
2017-09-01 13:08:20 -07:00
8ef302a435 Merge pull request #34625 from dnephin/more-linters
Add interfacer and unconvert linters
Upstream-commit: cb952bf00695b3429476f59c5534a9c604c6f010
Component: engine
2017-09-01 08:46:08 -07:00
9cb0439501 Move ErrorContains to an internal package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e62b2d410cda6ac9166ac8d052fd3fb99a9460bf
Component: engine
2017-08-25 12:04:58 -04:00
157456237a Add interfacer linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 709bf8b7bcc67f3ea3a7a39e29af8ae16a38b06f
Component: engine
2017-08-24 15:08:26 -04:00
94c685a721 Add deadcode linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 62c1f0ef41e6cd88a8846da1c11976a320ca8b41
Component: engine
2017-08-21 18:18:50 -04:00
6b3b192846 Add goimports to linters.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 372670b5074b077927314cdf46af30f8752e7db0
Component: engine
2017-08-21 18:15:08 -04:00
e89e83b8bc client should return imageNotFound error when API returns 404 status code
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 33d82b78d03f7db4ef743951c6a004ba4fe64637
Component: engine
2017-08-15 17:16:02 -04:00
417e5624cd Fix requests for docker host ending with slash
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 823e88d4c4298c38130b9a387a45c47cf957a931
Component: engine
2017-08-11 10:47:02 -07:00
a66a5d1d6a fix client.Transport
`client.Transport` is `http.Client.Transport` just has `RoundTripper()`. Not `http.Transport`. So we cannot convert it here.

For a mock test, I can play with this https://play.golang.org/p/gs7_QrL9-Y

Signed-off-by: wrfly <mr.wrfly@gmail.com>
Upstream-commit: e345cd12f96b3985257652b606c8463a5772944b
Component: engine
2017-08-03 17:14:26 +08:00
7deeee36b6 Remove client/session package, depend on buildkit's session package
gofmt -w -r '"github.com/docker/docker/client/session" -> "github.com/moby/buildkit/session"'
gofmt -w -r '"github.com/docker/docker/client/session/filesync" -> "github.com/moby/buildkit/session/filesync"'

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 41445a4745451b99d1c361c6c87447da790cb01b
Component: engine
2017-07-28 16:34:23 -07:00
5ff9e5001c Fix panic in hijack
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 7a53991bd6200b875e492d9c3f8e99a9a0c11056
Component: engine
2017-07-25 22:46:41 -07:00
5eaf5cc8fa Merge pull request #33887 from thaJeztah/update-version-error
Fix NewVersionError() for clients using default version
Upstream-commit: 45cad73ea8abc5e87d5db1a4a47c8565531d769f
Component: engine
2017-07-12 15:24:00 +02:00