Commit Graph

3072 Commits

Author SHA1 Message Date
1c29e89e9b Return 400 status instead of 500 for empty volume create body
The `POST /volumes/create` expects a request body to be provided.
If no body was provided, a 500 status was returned. A 500 status
is incorrect, because the request is invalid (it's not a server
error).

Before this change:

    $ curl --unix-socket /var/run/docker.sock -v -X POST http://localhost/volumes/create

    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > POST /volumes/create HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.51.0
    > Accept: */*
    >
    < HTTP/1.1 500 Internal Server Error
    < Api-Version: 1.30
    < Content-Length: 18
    < Content-Type: application/json
    < Date: Wed, 19 Jul 2017 11:29:26 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.06.0-ce (linux)
    <
    {"message":"EOF"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

After this change:

    $ curl --unix-socket /var/run/docker.sock -v -X POST http://localhost/volumes/create

    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > POST /volumes/create HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Api-Version: 1.36
    < Content-Type: application/json
    < Docker-Experimental: false
    < Ostype: linux
    < Server: Docker/dev (linux)
    < Date: Tue, 09 Jan 2018 15:00:13 GMT
    < Content-Length: 42
    <
    {"message":"no body provided in request"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5ad1e4be6bd2fd1033bc2adb5be2fe821787b59c
Component: engine
2018-01-16 20:42:44 +01:00
a9d5589889 Merge pull request #36021 from yongtang/30897-follow-up
Rename FindUniqueNetwork to FindNetwork
Upstream-commit: be146652108f7145e902c275807f9ef71464b031
Component: engine
2018-01-16 09:38:16 +01:00
d7084e8097 Merge pull request #35638 from cpuguy83/error_helpers2
Add helpers to create errdef errors
Upstream-commit: c36274da8326c59aaa12c48196671b41dcb89e5b
Component: engine
2018-01-15 10:56:46 -08:00
72b954bd11 Rename FindUniqueNetwork to FindNetwork
This fix is a follow up to 30397, with `FindUniqueNetwork`
changed to `FindNetwork` based on the review feedback.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ccc2ed01894a1950eaf47db2ad0860ad87cd78d1
Component: engine
2018-01-15 17:34:40 +00:00
1240c39efc Golint: don't use basic untyped string for context key
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: dfac74a9e48d1562ec41bc6de194f6593f0e639b
Component: engine
2018-01-15 12:49:14 +01:00
d4d0b5c268 Move api/errdefs to errdefs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d453fe35b9b8b52d0677fe0c3cc8373f2f5d30d0
Component: engine
2018-01-11 21:21:43 -05:00
952c29f8da Add helpers to create errdef errors
Instead of having to create a bunch of custom error types that are doing
nothing but wrapping another error in sub-packages, use a common helper
to create errors of the requested type.

e.g. instead of re-implementing this over and over:

```go
type notFoundError struct {
  cause error
}

func(e notFoundError) Error() string {
  return e.cause.Error()
}

func(e notFoundError) NotFound() {}

func(e notFoundError) Cause() error {
  return e.cause
}
```

Packages can instead just do:

```
  errdefs.NotFound(err)
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 87a12421a94faac294079bebc97c8abb4180dde5
Component: engine
2018-01-11 21:21:43 -05:00
dc5184e050 Merge pull request #30897 from yongtang/30242-network-duplicate-names
Update `FindNetwork` to address network name duplications
Upstream-commit: 484612f388cabf4b6f4df915f2bf268a8ffdd9fc
Component: engine
2018-01-10 05:30:58 -08:00
5017f2840c Merge pull request #35593 from ndeloof/master
Improve swagger schema for code generation
Upstream-commit: 16a1736b9b93e44c898f95d670bbaf20a558103d
Component: engine
2018-01-08 12:17:56 +01:00
5857ab9402 Merge pull request #35798 from ndeloof/ProgressDetail
Progress detail
Upstream-commit: 847df43d1df0ef7343d4f623138dcbb4307d6083
Component: engine
2018-01-08 11:28:49 +01:00
7ee813acf5 Update and use FindNetwork on Windows.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: b249ccb1151a3c2c7e442b6c1a769821afb28fe4
Component: engine
2018-01-07 03:32:37 +00:00
df9a679f90 Update FindUniqueNetwork to address network name duplications
This fix is part of the effort to address 30242 where
issue arise because of the fact that multiple networks
may share the same name (within or across local/swarm scopes).

The focus of this fix is to allow creation of service
when a network in local scope has the same name as the
service network.

An integration test has been added.

This fix fixes 30242.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: cafed80cd019a8b40025eaa5e5b37459362607fb
Component: engine
2018-01-06 01:55:28 +00:00
2af5d43021 Fix environ substitutions in docker commit --change ...
The building machinery was being handed an uninitialized container
Config.  This changes it to use the target container's Config.

Resolves #30538

Signed-off-by: Anthony Sottile <asottile@umich.edu>
Upstream-commit: 0785836c4b440a8d4a5dfdb8df82e50f9f4d23a1
Component: engine
2017-12-20 11:03:38 -08:00
756e315027 fix attribute names on ProgressDetail
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 5e63edfa935e4f87e588d358d7060227745de288
Component: engine
2017-12-16 09:38:34 +01:00
264a31ea91 CreateImage uses ‘id’ to track layers
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: cfa07bffb5e27763fa4bb189133dadd179e4bd23
Component: engine
2017-12-16 09:38:34 +01:00
7b36860dee BuildInfo uses ‘aux’ to document image ID after build
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 9e29d2ea49aaee9cd92fa3fe026ff5f8ab1f8a25
Component: engine
2017-12-16 09:38:33 +01:00
0834563329 use swagger support for « title » as generated types names for inline schema
align naming convention with x-go-name

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 8e7f9afa471c2be079f2c8897cf3b87e7f60544e
Component: engine
2017-12-13 18:54:37 +01:00
1305053a0b Merge pull request #35738 from thaJeztah/bump-api-version
Bump API version to 1.36
Upstream-commit: 3b14e5980ef681c47faf128b5c23cb972fd8851d
Component: engine
2017-12-08 22:18:24 -08:00
7b0f6565c5 Merge pull request #35720 from ripcurld0/weboscket_debug
Add a debug message when client closes websocket attach connection
Upstream-commit: 9f5540f672e618667a8a3f185193232cc4d52617
Component: engine
2017-12-07 16:53:56 -08:00
17ee87b9ed Bump API version to 1.36
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c1e982f2ee85580687e2d355af3ca444ada14d01
Component: engine
2017-12-07 13:52:49 -08:00
96784302eb Merge pull request #35705 from tiborvass/platform-version
api: generalize version information to any platform component
Upstream-commit: a1be987ea9e03e5ebdb1b415a7acdd8d6f0aaa08
Component: engine
2017-12-06 16:43:38 -08:00
947ed56f66 Adjust swagger definitions
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 87ebfa11f66d2109054ad3024217a5101b45aa8c
Component: engine
2017-12-06 23:23:55 +01:00
3916dafe17 api: generalize version information to any platform component
This change adds a Platform struct with a Name field and a general
Components field to the Version API type. This will allow API
consumers to show version information for the whole platform and
it will allow API providers to set the versions for the various
components of the platform.

All changes here are backwards compatible.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 9152e63290e4a4e586b811cce39082efc649b912
Component: engine
2017-12-06 23:23:55 +01:00
7661258841 Merge pull request #35721 from dnephin/fix-swagger-spec-errors
Fix codegen problems in swagger spec
Upstream-commit: 7f4cf43637067d27a1035d4ff412710ead82bbab
Component: engine
2017-12-06 13:36:52 -08:00
02ebcae82d Merge pull request #35146 from masaeedu/27919-removemultitypes
Change multi-type parameters to single type
Upstream-commit: 7db57f7fcac33583403d1d4ccf52b1c27f7e0ad1
Component: engine
2017-12-06 16:22:17 -05:00
3ef7b79d93 Fix codegen problems in swagger spec
Code generation does't support multiple types

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3648d883556e59392e3e5a05ef5de1b56b68c6fc
Component: engine
2017-12-06 13:38:45 -05:00
1be15401b4 Add a debug message when client closes websocket attach connection
When the client closes websocket connections that sends container
output through websocket, an error message is displayed:
"Error attaching websocket: %!s(<nil>)"

This message is misleading. Thus, this change suggests to check
if error is nil and print the correct message accordingly.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 8f65bb6d90e3a95420bb634e415c3cce36d86201
Component: engine
2017-12-06 16:57:41 +02:00
41a5926818 Merge pull request #35661 from ndeloof/8917
introduce `workingdir` option for docker exec
Upstream-commit: 5e5fadb3c0201553929d4a6ea8dc8f9d8a1e56fe
Component: engine
2017-12-06 12:40:25 +01:00
bf78150b9b Merge pull request #35600 from nictuku/go_option
Set a go_package on api/types/swarm/runtime to make it Bazel compatible
Upstream-commit: 7ef9266ba090a3230355c39352dddf41aeb5b726
Component: engine
2017-12-01 17:30:12 -08:00
5016fee3dc Merge pull request #35578 from thaJeztah/fix-portbindings-swagger
Fix PortBindings definition in Swagger
Upstream-commit: ac68411f85a1c4540c0d4f5b7db86b0b0422f025
Component: engine
2017-12-01 17:46:38 -05:00
148bfd3114 introduce workingdir option for docker exec
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 19f2749d3906707717aeec9da27c499bcdc07da8
Component: engine
2017-12-01 09:06:07 +01:00
59e5477bf3 Set a go_package on api/types/swarm/runtime to make it Bazel compatible
Signed-off-by: Yves Junqueira <yves.junqueira@gmail.com>
Upstream-commit: 44f61e0f860447e198ca044f1cbdac73c5aa2bbf
Component: engine
2017-11-25 04:26:16 -08:00
01d480da3c duplicate definitions for API response with just an ID
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: d6935a8f1a4003c0b6f1b89a0e28e721d0756ac9
Component: engine
2017-11-24 11:41:04 +01:00
749a92c1a6 schema is missing CanRemove & DetachKeys
example demonstrates they are expected

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 74cb739766e517115c5af9cee2202613661238a0
Component: engine
2017-11-24 11:40:12 +01:00
12aa8ed3d8 memory is an int64 (long)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Upstream-commit: 5ad85b1d4d69806754d1814f019b03b57e40d6da
Component: engine
2017-11-23 14:24:43 +01:00
3ceb534c1b Fix PortBindings definition in Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a50cf8aa44f2a5abb5900d39008d075d2e8c2850
Component: engine
2017-11-22 17:55:37 +01:00
be9497fbf4 Fix consumes MIME type for NetworkConnect
This route expects `application/json`. Sending a content type header of `application/octet-stream` results in an error.

Signed-off-by: Asad Saeeduddin <masaeedu@gmail.com>
Upstream-commit: 876b32861789a0424557c640622bde47eedd2d98
Component: engine
2017-11-18 22:34:23 -05:00
e52bfcca39 fixed special character
`scope`=<string> local or swarm had special character, which was breaking the Swagger UI

Signed-off-by: Jeeva S. Chelladhurai <sjeeva@gmail.com>
Upstream-commit: a21654c34b741656582b09e09127821311909dcd
Component: engine
2017-11-08 19:17:24 +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
e3495e0554 Merge pull request #35382 from thaJeztah/fix-api-version
Fix API version
Upstream-commit: a9182202f76be31a7bec510dd00cf24677e58c7e
Component: engine
2017-11-03 09:52:55 +01:00
b878f3dd1f Fix API version
Commit 3ba1dda1914fa7d380d9d3220c3b158a41f90cba bumped
the API version, but forgot to actually bump the version
in code.

This patch fixes the version to match those changes :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7f8dbe4a86650b02ffb490098b9f3bf0912c575d
Component: engine
2017-11-02 13:08:27 +01:00
bd820b2e31 Remove Docker/API version matrix
The Swagger file contained a version matrix to
find which API version is used by which version
of Docker.

Given that Docker is a downstream of the Moby project,
we should not be maintaining such a matrix in this
repository.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3fb228ba50ccb921148e0174e5e5e45ab650c3e5
Component: engine
2017-11-01 22:29:26 +01:00
45def429d3 Merge pull request #34424 from simonferquel/swarm-service-isolation
Added support for swarm service isolation mode
Upstream-commit: d91c5f42eb37c6f88cec4021c10c0a1ded1785c3
Component: engine
2017-11-01 16:41:10 -04: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
7bfb66c670 Merge pull request #35347 from lioncruise/patch-1
Fix grammatical problems in several annotations
Upstream-commit: 100ec844ccad6b79bcb11650e32e9a05ff51a441
Component: engine
2017-10-31 15:25:27 -07:00
9e1b28e972 Merge pull request #35343 from thaJeztah/bump-api-version-1.35
Bump API version to 1.35
Upstream-commit: 3ba1dda1914fa7d380d9d3220c3b158a41f90cba
Component: engine
2017-10-31 12:37:12 -07:00
95c878aac5 Fix grammatical problems in several annotations
Signed-off-by: qinshijun <272700767@qq.com>
Upstream-commit: 3c376a882b89bc1ff4f7b47667f49440a516bd70
Component: engine
2017-10-31 22:47:58 +08:00
6b11145c27 Bump API version to 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ba6b5aa7f28dbc76c6e0c494eb228a652a0d55a7
Component: engine
2017-10-31 12:57:14 +01:00
2700d23ec3 Merge pull request #35102 from ripcurld0/doc_31926
Elaborate more about port allocation in docs
Upstream-commit: a6f09a7509cd77b4ce0bf26845a253a7d9997d11
Component: engine
2017-10-30 20:28:36 +01:00
1377e81acb Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: f28cb422e69bd4239401e6ea32b65b56485d6691
Component: engine
2017-10-30 16:16:18 +01:00