Commit graph

3079 commits

Author SHA1 Message Date
Yong Tang
d63a5a1ff5 Fix network alias issue
This fix tries to address the issue raised in 33661 where
network alias does not work when connect to a network the second time.

This fix address the issue.

This fix fixes 33661.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-23 01:04:33 +00:00
Vincent Demeester
fbed4eb8c7
Merge pull request #36013 from thaJeztah/improve-version-middleware-test
Improve API version-middleware test
2018-01-22 14:59:06 -08:00
Vincent Demeester
f97256cbf1
Merge pull request #35744 from ndeloof/35702
closes #35702 introduce « exec_die » event
2018-01-19 15:03:50 -08:00
Brian Goff
bb6ce89737
Merge pull request #34859 from Microsoft/jjh/singleimagestore
LCOW: Coalesce daemon stores, allow dual LCOW and WCOW mode
2018-01-19 11:38:30 -05:00
John Howard
ce8e529e18 LCOW: Re-coalesce stores
Signed-off-by: John Howard <jhoward@microsoft.com>

The re-coalesces the daemon stores which were split as part of the
original LCOW implementation.

This is part of the work discussed in https://github.com/moby/moby/issues/34617,
in particular see the document linked to in that issue.
2018-01-18 08:29:19 -08:00
Sebastiaan van Stijn
5ad1e4be6b
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>
2018-01-16 20:42:44 +01:00
Vincent Demeester
be14665210
Merge pull request #36021 from yongtang/30897-follow-up
Rename FindUniqueNetwork to FindNetwork
2018-01-16 09:38:16 +01:00
Yong Tang
c36274da83
Merge pull request #35638 from cpuguy83/error_helpers2
Add helpers to create errdef errors
2018-01-15 10:56:46 -08:00
Yong Tang
ccc2ed0189 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>
2018-01-15 17:34:40 +00:00
Sebastiaan van Stijn
dfac74a9e4
Golint: don't use basic untyped string for context key
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-15 12:49:14 +01:00
Sebastiaan van Stijn
63906d8fae
Improve API version-middleware test
Some improvements to the test;

- Combine tests to reduce duplicated code
- Add test-cases for empty version in request using the default version
- Add test for valid versions in request actually setting the version

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-15 11:50:30 +01:00
Brian Goff
d453fe35b9 Move api/errdefs to errdefs
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-01-11 21:21:43 -05:00
Brian Goff
87a12421a9 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>
2018-01-11 21:21:43 -05:00
Yong Tang
484612f388
Merge pull request #30897 from yongtang/30242-network-duplicate-names
Update `FindNetwork` to address network name duplications
2018-01-10 05:30:58 -08:00
Sebastiaan van Stijn
16a1736b9b
Merge pull request #35593 from ndeloof/master
Improve swagger schema for code generation
2018-01-08 12:17:56 +01:00
Nicolas De Loof
aa6bb5cb69
introduce « exec_die » event
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2018-01-08 11:42:25 +01:00
Sebastiaan van Stijn
847df43d1d
Merge pull request #35798 from ndeloof/ProgressDetail
Progress detail
2018-01-08 11:28:49 +01:00
Yong Tang
b249ccb115 Update and use FindNetwork on Windows.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-07 03:32:37 +00:00
Yong Tang
cafed80cd0 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>
2018-01-06 01:55:28 +00:00
Anthony Sottile
0785836c4b 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>
2017-12-20 11:03:38 -08:00
Nicolas De Loof
5e63edfa93
fix attribute names on ProgressDetail
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-16 09:38:34 +01:00
Nicolas De Loof
cfa07bffb5
CreateImage uses ‘id’ to track layers
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-16 09:38:34 +01:00
Nicolas De Loof
9e29d2ea49
BuildInfo uses ‘aux’ to document image ID after build
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-16 09:38:33 +01:00
Nicolas De Loof
8e7f9afa47
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>
2017-12-13 18:54:37 +01:00
Sebastiaan van Stijn
3b14e5980e
Merge pull request #35738 from thaJeztah/bump-api-version
Bump API version to 1.36
2017-12-08 22:18:24 -08:00
Sebastiaan van Stijn
9f5540f672
Merge pull request #35720 from ripcurld0/weboscket_debug
Add a debug message when client closes websocket attach connection
2017-12-07 16:53:56 -08:00
Sebastiaan van Stijn
c1e982f2ee
Bump API version to 1.36
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-07 13:52:49 -08:00
Sebastiaan van Stijn
a1be987ea9
Merge pull request #35705 from tiborvass/platform-version
api: generalize version information to any platform component
2017-12-06 16:43:38 -08:00
Tibor Vass
87ebfa11f6 Adjust swagger definitions
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-12-06 23:23:55 +01:00
Tibor Vass
9152e63290 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>
2017-12-06 23:23:55 +01:00
Sebastiaan van Stijn
7f4cf43637
Merge pull request #35721 from dnephin/fix-swagger-spec-errors
Fix codegen problems in swagger spec
2017-12-06 13:36:52 -08:00
Daniel Nephin
7db57f7fca
Merge pull request #35146 from masaeedu/27919-removemultitypes
Change multi-type parameters to single type
2017-12-06 16:22:17 -05:00
Daniel Nephin
3648d88355 Fix codegen problems in swagger spec
Code generation does't support multiple types

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-12-06 13:38:45 -05:00
Boaz Shuster
8f65bb6d90 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>
2017-12-06 16:57:41 +02:00
Vincent Demeester
5e5fadb3c0
Merge pull request #35661 from ndeloof/8917
introduce `workingdir` option for docker exec
2017-12-06 12:40:25 +01:00
Yong Tang
7ef9266ba0
Merge pull request #35600 from nictuku/go_option
Set a go_package on api/types/swarm/runtime to make it Bazel compatible
2017-12-01 17:30:12 -08:00
Daniel Nephin
ac68411f85
Merge pull request #35578 from thaJeztah/fix-portbindings-swagger
Fix PortBindings definition in Swagger
2017-12-01 17:46:38 -05:00
Nicolas De Loof
19f2749d39 introduce workingdir option for docker exec
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-12-01 09:06:07 +01:00
Yves Junqueira
44f61e0f86 Set a go_package on api/types/swarm/runtime to make it Bazel compatible
Signed-off-by: Yves Junqueira <yves.junqueira@gmail.com>
2017-11-25 04:26:16 -08:00
Nicolas De Loof
d6935a8f1a duplicate definitions for API response with just an ID
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-11-24 11:41:04 +01:00
Nicolas De Loof
74cb739766 schema is missing CanRemove & DetachKeys
example demonstrates they are expected

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-11-24 11:40:12 +01:00
Nicolas De loof
5ad85b1d4d
memory is an int64 (long)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2017-11-23 14:24:43 +01:00
Sebastiaan van Stijn
a50cf8aa44
Fix PortBindings definition in Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-11-22 17:55:37 +01:00
Asad Saeeduddin
876b328617 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>
2017-11-18 22:34:23 -05:00
Jeeva S. Chelladhurai
a21654c34b 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>
2017-11-08 19:17:24 +00:00
Sebastiaan van Stijn
68a4552529
Merge pull request #32914 from jamiehannaford/until-logging
Add --until flag for docker logs; closes #32807
2017-11-03 16:08:30 +01:00
Sebastiaan van Stijn
a9182202f7
Merge pull request #35382 from thaJeztah/fix-api-version
Fix API version
2017-11-03 09:52:55 +01:00
Sebastiaan van Stijn
7f8dbe4a86
Fix API version
Commit 3ba1dda191 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>
2017-11-02 13:08:27 +01:00
Sebastiaan van Stijn
3fb228ba50
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>
2017-11-01 22:29:26 +01:00
Brian Goff
d91c5f42eb
Merge pull request #34424 from simonferquel/swarm-service-isolation
Added support for swarm service isolation mode
2017-11-01 16:41:10 -04:00