Commit graph

3292 commits

Author SHA1 Message Date
Tonis Tiigi
22f7caee03 builder: experimental buildkit base
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-10 10:05:26 -07:00
Vincent Demeester
e401b88e59
Add support for init on services
It's already supported by `swarmkit`, and act the same as
`HostConfig.Init` on container creation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-07 14:17:55 +02:00
Jess Frazelle
3694c1e34e
api: add configurable MaskedPaths and ReadOnlyPaths to the API
This adds MaskedPaths and ReadOnlyPaths options to HostConfig for containers so
that a user can override the default values.

When the value sent through the API is nil the default is used.
Otherwise the default is overridden.

Adds integration tests for MaskedPaths and ReadonlyPaths.

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-05 12:33:14 -04:00
Sebastiaan van Stijn
5037c5a8ce
Merge pull request #36688 from cpuguy83/volumes_service
Extract volume interaction to a volumes service
2018-06-05 02:16:20 +02:00
Brian Goff
f51a96c016 Move plugin client creation to the extension point
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-25 15:18:53 -04:00
Brian Goff
e4b6adc88e Extract volume interaction to a volumes service
This cleans up some of the package API's used for interacting with
volumes, and simplifies management.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-25 14:21:07 -04:00
Sebastiaan van Stijn
df5175e1ee
Bump API version to v1.38
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-24 02:39:28 +02:00
Sebastiaan van Stijn
8e2f920306
Merge pull request #37108 from thaJeztah/remove_unneeded_aliases
Various code-cleanup
2018-05-24 01:38:56 +02:00
Brian Goff
5a68e2617d
Merge pull request #35246 from dperny/attachment-inspect
Output network attachment task information
2018-05-23 15:44:39 -04:00
Sebastiaan van Stijn
f23c00d870
Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-23 17:50:54 +02:00
Sebastiaan van Stijn
3682703ad4
Update swagger and API history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-22 23:37:33 +02:00
Drew Erny
5b69ff466e
Output network attachment task information
Adds functionality to parse and return network attachment spec
information. Network attachment tasks are phony tasks created in
swarmkit to deal with unmanaged containers attached to swarmkit. Before
this change, attempting `docker inspect` on the task id of a network
attachment task would result in an empty task object. After this change,
a full task object is returned

Fixes #26548 the correct way.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-22 23:36:30 +02:00
Sebastiaan van Stijn
8b6b559866
Set item-type for ExecIDs
Arrays expect a type to be set for items in the array.

This patch adds the "string" type, adds a short description,
and some example values.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-22 13:18:44 +02:00
Vincent Demeester
da99009bbb
Merge pull request #35402 from thaJeztah/fix-GetTimestamp-parsing
Improve GetTimestamp parsing
2018-05-22 12:28:01 +02:00
Sebastiaan van Stijn
48cfe3f087
Improve GetTimestamp parsing
`GetTimestamp()` "assumed" values it could not parse
to be a valid unix timestamp, and would use invalid
values ("hello world") as-is (even testing that
it did so).

This patch validates unix timestamp to be a valid
numeric value, and makes other values invalid.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-20 13:07:17 +02:00
Grant Millar
58a35eaede Fix swagger file type for ExecIds
Signed-off-by: Grant Millar <grant@seednet.eu>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-19 22:14:38 +02:00
Sebastiaan van Stijn
3646562a5c
Merge pull request #37088 from ohbarye/fix-typos-duplicated-the
Fix typos: remove duplicated "the"
2018-05-19 20:57:47 +02:00
Tibor Vass
1b75e17584
Merge pull request #37091 from thaJeztah/fix-linting-errors
Fix some linting issues
2018-05-19 08:39:39 -10:00
Sebastiaan van Stijn
4f8c870d62
Fix some linting issues
These showed locally when running `make validate`. CI doesn't seem to have the
same (possibly it's disabled in the configuration)

    builder/fscache/fscache.go:618::error: github.com/docker/docker/vendor/github.com/tonistiigi/fsutil.StatInfo composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:44::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:20::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:113::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:110::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:171::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:413::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:203::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:584::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:109::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:388::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/volumes_windows.go:27::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    integration/service/network_test.go:31::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    api/server/server.go:129:10⚠️ should not use basic type string as key in context.WithValue (golint)
    integration/service/network_test.go:54::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:61::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:74::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    pkg/archive/archive_windows.go:76::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    plugin/manager_linux.go:56::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-17 19:28:27 +02:00
AJ Bowen
b7fe0b6359
Highlight meaning of 'precpu' (i.e. 'previous').
Signed-off-by: AJ Bowen <aj@soulshake.net>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-17 14:57:44 +02:00
ohbarye
0f95b23d98 Fix typos: remove duplicated "the"
Signed-off-by: Masato Ohba <over.rye@gmail.com>
2018-05-17 21:49:51 +09:00
emanb29
13e0b26510
Describe IP field of Port definition
Signed-off-by: Ethan Bell <ebgamer29@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-15 12:09:42 +02:00
Brian Goff
b16b125bb4 Fix swagger volume type generation
This was broken by bf6a790f00

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-14 13:46:20 -04:00
Kir Kolyshkin
7d62e40f7e Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-23 13:52:44 -07:00
Wassim Dhif
2058928edc Fix version mismatch in API documentation
Fix a version mismatch in the API documentation.

Signed-off-by: Wassim DHIF <wassimdhif@gmail.com>
2018-04-23 18:57:35 +02:00
Vincent Demeester
f4106b46db
Remove daemon dependency on api packages
We are using interface in the api routers to not explicitely depend on
the daemon struct (`daemon.Daemon`), but somehow, we do depend on the
`daemon` package for the cluster functionalities.

This removes this dependency by defining the correct interfaces.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-20 11:06:40 +02:00
Anusha Ragunathan
9689059b56
Merge pull request #35831 from anusha-ragunathan/splunk_partial
Improve partial message support in logger
2018-04-12 17:38:27 -07:00
Anusha Ragunathan
0b4b0a7b5d Improve partial message support in logger
Docker daemon has a 16K buffer for log messages. If a message length
exceeds 16K, it should be split by the logger and merged at the
endpoint.

This change adds `PartialLogMetaData` struct for enhanced partial support
- LastPartial (bool) : indicates if this is the last of all partials.
- ID (string)        : unique 32 bit ID. ID is same across all partials.
- Ordinal (int starts at 1) : indicates the position of msg in the series of partials.
Also, the timestamps across partials in the same.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2018-04-11 13:26:28 -07:00
Sebastiaan van Stijn
045206a45c
Merge pull request #36724 from dnephin/api-docs-add-build-target
Add target field to build API docs
2018-04-02 22:35:00 -07:00
Brian Goff
9d46c4c138 Support cancellation in directory.Size()
Makes sure that if the user cancels a request that the daemon stops
trying to traverse a directory.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-03-29 15:49:15 -04:00
Daniel Nephin
95ccb55fe2 Add target field to build API docs
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-28 14:34:58 -04:00
Daniel Nephin
6be0f70983 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:43 -04:00
Emil Davtyan
117cd7ff64 Content encoding negotiation added to archive request.
Signed-off-by: Emil Davtyan <emil2k@gmail.com>
2018-02-24 06:41:45 +01:00
Sebastiaan van Stijn
a3efeaad52
Adjust minimum API version for templated configs/secrets
Also adds a note to the API version history

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-21 15:23:00 +01:00
Sebastiaan van Stijn
453f2b8b40
Bump default API version to 1.37
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-21 15:22:40 +01:00
Sebastiaan van Stijn
0076343b29
Merge pull request #33702 from aaronlehmann/templated-secrets-and-configs
Templated secrets and configs
2018-02-21 13:39:10 +01:00
Akihiro Suda
8e435b8279 Support SCTP port mapping (bump up API to v1.37)
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-02-20 11:15:36 +09:00
Brian Goff
a407761e48 Error out on secret/config templates for older API
Makes sure if the user specifies an older API version that we don't pass
through templating options for versions that templating was not
supported.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-16 11:25:14 -05:00
Brian Goff
8e8f5f4457 Always mount configs with tmpfs
This makes configs and secrets behavior identical.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-16 11:25:14 -05:00
Aaron Lehmann
c5df7235f6 api: Add Templating parameter to SecretSpec and ConfigSpec
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2018-02-16 11:25:13 -05:00
Daniel Nephin
e574c5ae73 Move commit to container backend
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-14 16:06:12 -05:00
John Stephens
04cb98e6b5
Merge pull request #36269 from Microsoft/jjh/remove-lcow-api-platform-if-omitted
Remove interim env var LCOW_API_PLATFORM_IF_OMITTED
2018-02-13 15:12:18 -08:00
Brian Goff
060893ab5d
Merge pull request #36271 from dnephin/use-tag-image-in-commit
Use TagImage in Commit
2018-02-13 16:40:17 -05:00
Yong Tang
9cbe066e27
Merge pull request #36246 from sirreal/fix/swagger-buildargs-type
Fix string type for buildargs API definition
2018-02-12 11:21:42 -08:00
Jon Surrell
344c73ac67
Add example buildargs usage
Signed-off-by: Jon Surrell <jon.surrell@gmail.com>
2018-02-12 14:09:37 +01:00
Jon Surrell
de2b2b5e4b
Reformat to multi-line
Signed-off-by: Jon Surrell <jon.surrell@gmail.com>
2018-02-12 14:09:31 +01:00
Daniel Nephin
afb3eda697 Use TagImage in Commit
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-09 20:53:39 -05:00
John Howard
c111fec758 Remove interim env var LCOW_API_PLATFORM_IF_OMITTED
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-02-09 12:05:07 -08:00
Akihiro Suda
9769ef333f
Merge pull request #36224 from dnephin/refactor-commit
Refactor Daemon.Commit()
2018-02-08 21:02:30 +09:00
Jon Surrell
f281358ba2
Fix string type for buildargs API definition
Signed-off-by: Jon Surrell <jon.surrell@gmail.com>
2018-02-08 13:00:24 +01:00
Daniel Nephin
daff039049 Refactor commit
The goal of this refactor is to make it easier to integrate buildkit
and containerd snapshotters.

Commit is used from two places (api and build), each calls it
with distinct arguments. Refactored to pull out the common commit
logic and provide different interfaces for each consumer.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-07 15:09:06 -05:00
Daniel Nephin
4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Yong Tang
3a6f8cfd51
Merge pull request #36146 from yongtang/36142-TaskState
Add `REMOVE` and `ORPHANED` to TaskState
2018-02-02 11:33:25 -08:00
Yong Tang
9247e09944 Fix issue of ExitCode and PID not show up in Task.Status.ContainerStatus
This fix tries to address the issue raised in 36139 where
ExitCode and PID does not show up in Task.Status.ContainerStatus

The issue was caused by `json:",omitempty"` in PID and ExitCode
which interprate 0 as null.

This is confusion as ExitCode 0 does have a meaning.

This fix removes  `json:",omitempty"` in ExitCode and PID,
but changes ContainerStatus to pointer so that ContainerStatus
does not show up at all if no content. If ContainerStatus
does have a content, then ExitCode and PID will show up (even if
they are 0).

This fix fixes 36139.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-31 15:35:19 +00:00
Yong Tang
a40687f5ac Add REMOVE and ORPHANED to TaskState
This fix tries to address the issue raised in 36142 where
there are discrepancies between Swarm API and swagger.yaml.

This fix adds two recently added state `REMOVE` and `ORPHANED` to TaskState.

This fix fixes 36142.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 16:46:05 +00:00
Sebastiaan van Stijn
40a9d5d24c
Merge pull request #35946 from joelwurtz/patch-2
Fix Volumes property definition in ContainerConfig
2018-01-29 20:57:09 -08:00
Yong Tang
958200970f
Merge pull request #36074 from shutefan/master
Update API docs to show that /containers/{id}/kill returns HTTP 409
2018-01-28 08:32:35 -08:00
Yong Tang
093a5402a0
Merge pull request #34655 from nmeyerhans/document-init-api
Add Init API field documentation to swagger
2018-01-25 10:16:27 -08:00
Sebastiaan van Stijn
2b2265acbb
Merge pull request #35989 from dani-docker/orca-11380
verbose info is missing for partial overlay ID
2018-01-24 16:01:31 -08:00
Noah Meyerhans
467ea71e5e
Add Init API field documentation to swagger
Signed-off-by: Noah Meyerhans <nmeyerha@amazon.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-01-24 09:46:12 -08:00
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
Dani Louca
2e0990f165 fix verbose for partial overlay ID
Signed-off-by: Dani Louca <dani.louca@docker.com>
2018-01-22 18:50:49 -05: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
shutefan
3a1bb49b41 Update API docs to show that /containers/{id}/kill returns HTTP 409
Signed-off-by: Stephan Spindler <shutefan@gmail.com>
2018-01-20 17:21:49 +01: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
Joel Wurtz
dc883c0486
Fix Volumes property definition in ContainerConfig
Actually the specification was expecting a 'additionalProperties' for the Volumes data, where in fact it's expecting
a map of string pointing to empty object.

Signed-off-by: Joel Wurtz <joel.wurtz@gmail.com>
2018-01-06 16:12:05 +01: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
Jamie Hannaford
e8d9a61f4c Add --until flag for docker logs; closes #32807
Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
2017-11-01 10:08:49 +01:00
Yong Tang
100ec844cc
Merge pull request #35347 from lioncruise/patch-1
Fix grammatical problems in several annotations
2017-10-31 15:25:27 -07:00
Yong Tang
3ba1dda191
Merge pull request #35343 from thaJeztah/bump-api-version-1.35
Bump API version to 1.35
2017-10-31 12:37:12 -07:00
Shijun Qin
3c376a882b Fix grammatical problems in several annotations
Signed-off-by: qinshijun <272700767@qq.com>
2017-10-31 22:47:58 +08:00
Sebastiaan van Stijn
ba6b5aa7f2
Bump API version to 1.35
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-31 12:57:14 +01:00
Sebastiaan van Stijn
a6f09a7509
Merge pull request #35102 from ripcurld0/doc_31926
Elaborate more about port allocation in docs
2017-10-30 20:28:36 +01:00
Simon Ferquel
f28cb422e6 Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
2017-10-30 16:16:18 +01:00
Yong Tang
220d6c4aff
Merge pull request #34999 from kolyshkin/wait-on-rm
ContainerWait on remove: don't stuck on rm fail
2017-10-29 11:04:41 -07:00
Asad Saeeduddin
c6d32bebe5 Change multi-type parameters to single type
Signed-off-by: Asad Saeeduddin <masaeedu@gmail.com>
2017-10-26 06:10:24 -04:00
Kir Kolyshkin
f963500c54 ContainerWait on remove: don't stuck on rm fail
Currently, if a container removal has failed for some reason,
any client waiting for removal (e.g. `docker run --rm`) is
stuck, waiting for removal to succeed while it has failed already.
For more details and the reproducer, please check
https://github.com/moby/moby/issues/34945

This commit addresses that by allowing `ContainerWait()` with
`container.WaitCondition == "removed"` argument to return an
error in case of removal failure. The `ContainerWaitOKBody`
stucture returned to a client is amended with a pointer to `struct Error`,
containing an error message string, and the `Client.ContainerWait()`
is modified to return the error, if any, to the client.

Note that this feature is only available for API version >= 1.34.
In order for the old clients to be unstuck, we just close the connection
without writing anything -- this causes client's error.

Now, docker-cli would need a separate commit to bump the API to 1.34
and to show an error returned, if any.

[v2: recreate the waitRemove channel after closing]
[v3: document; keep legacy behavior for older clients]
[v4: convert Error from string to pointer to a struct]
[v5: don't emulate old behavior, send empty response in error case]
[v6: rename legacy* vars to include version suffix]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-10-25 13:11:56 -07:00
Sebastiaan van Stijn
e309f98b84 Merge pull request #35030 from tossmilestone/34459-fix-network-create-conflict-errcode
Fix returned error code for network creation from 500 to 409
2017-10-25 14:29:20 +02:00
Kenfe-Mickael Laventure
ddae20c032
Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-20 07:11:37 -07:00
Boaz Shuster
dfd706e1a5 Elaborate more about port allocation in docs
Describe more how host port allocation is done when
container is stopped/started in "PublishAllPorts".

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-10-17 15:19:54 +03:00
Victor Vieux
591b2eeeb3 Merge pull request #35151 from thaJeztah/always-return-version-information
Always return version and server headers
2017-10-11 18:11:35 -07:00
Sebastiaan van Stijn
1ffa10ee26 Merge pull request #35144 from Microsoft/jjh/fixdownlevel
Fix regression on inspect
2017-10-12 00:52:28 +02:00
Sebastiaan van Stijn
e9dac5ef5e
Always return version and server headers
If a 400 error is returned due to an API version mismatch, no
version and server-identification headers were returned by the API.

All information in these headers is "static", so there is no
reason to omit the information in case of an error being
returned.

This patch updates the version middleware to always
return the headers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-11 22:06:43 +02:00
Victor Vieux
6f117e266f Merge pull request #35150 from thaJeztah/fix-api-version-check
Return 400 error if API client is too new
2017-10-11 11:26:12 -07:00
Akim Demaille
ce58cd5a34 API: minor fixes in the README
The main point is to fix a non ASCII space character that wrecks the
markdown handling.

Signed-off-by: Akim Demaille <akim.demaille@docker.com>
2017-10-11 16:12:10 +02:00
Victor Vieux
b6aa01570c Merge pull request #35064 from LK4D4/replace_timer
Replace NewTimer().C with After
2017-10-10 08:47:37 -07:00
Sebastiaan van Stijn
01f9227ec9
Return 400 error if API client is too new
Commit e98e4a7111 implemented API version
negotiation using the `/_ping` endpoint. In that change, URL validation for the
maximum supported API version was removed from the API server (validation for
the _minimum_ version was kept in place).

With this feature, clients that support version negotiation would negotiate the
maximum version supported by the daemon, and downgrade to an older API version
if the client's default API version is not supported.

However, clients that do _not_ support version negotiation can call API versions
that are higher than the maximum supported version. Due to the missing version
check, this is silently ignored, and the daemon's default API version is used.

This is a problem, because the actual API version in use is non-deterministic;
for example, calling `/v9999.9999/version` on a daemon that runs API v1.34 will
use API v1.34, but calling the same URL on an older daemon may use API version
v1.24.

This patch reverts the removal of the API check for maximum supported versions.
The documentation has been updated accordingly

Before this patch is applied, the daemon returns a 200 (success):

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > GET /v9999.9999/version HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.54.0
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < Api-Version: 1.32
    < Content-Length: 240
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 09:11:29 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.09.0-ce (linux)
    <
    {"Version":"17.09.0-ce","ApiVersion":"1.32","MinAPIVersion":"1.12","GitCommit":"afdb6d4","GoVersion":"go1.8.3","Os":"linux","Arch":"amd64","KernelVersion":"4.9.49-moby","Experimental":true,"BuildTime":"2017-09-26T22:45:38.000000000+00:00"}
    * Connection #0 to host localhost left intact

After this patch is applied, a 400 (Bad Request) is returned:

    $ curl -v --unix-socket /var/run/docker.sock http://localhost/v9999.9999/version
    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > GET /v9999.9999/info HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Content-Type: application/json
    < Date: Tue, 10 Oct 2017 08:08:34 GMT
    < Content-Length: 89
    <
    {"message":"client version 9999.9999 is too new. Maximim supported API version is 1.34"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-10 11:17:48 +02:00
John Howard
f9b2a20819 Fix downlevel regression
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-10-09 13:47:28 -07:00
He Xiaoxi
ab1871872d Fix returned error code for network creation from 500 to 409
Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
2017-10-08 16:00:00 +08:00
John Howard
d98ecf2d6c LCOW: API change JSON header to string POST parameter
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-10-06 15:26:48 -07:00
John Howard
0380fbff37 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.
2017-10-06 11:44:18 -07:00
Alexander Morozov
1a517a4a42 Replace NewTimer().C with After
It is the same thing

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2017-10-04 14:24:19 -07:00
Sebastiaan van Stijn
fd90733972
Add PortConfig.PublishMode to API documentation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-10-04 15:34:08 +02:00
Sebastiaan van Stijn
288abf0854
Bump API version to 1.34
Docker 17.10 was cut off from ab2b03a0e1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-30 01:13:20 +02:00
Vincent Demeester
a343cba40c Merge pull request #34985 from thaJeztah/remove-use-of-deprecated-filter-functions
Remove use of deprecated filter functions
2017-09-27 17:34:07 +02:00
Allen Sun
4611ecd3cd add node/service/secret/config specific event filter
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
2017-09-27 00:23:51 +08:00
Sebastiaan van Stijn
74a084162c Merge pull request #34908 from thaJeztah/bump-api-version-1.33
Bump API version to 1.33
2017-09-26 18:09:50 +02:00
Sebastiaan van Stijn
a4efe66cf2
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 065118390a,
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>
2017-09-26 13:59:45 +02:00
Sebastiaan van Stijn
97c5ae25c4
Replace uses of filters.Include() with filters.Contains()
The `filters.Include()` method was deprecated in favor of `filters.Contains()`
in 065118390a, but still used in various
locations.

This patch replaces uses of `filters.Include()` with `filters.Contains()`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-26 13:39:56 +02:00
Daniel Nephin
27cfa68af1 Move RFC3339NanoFixed to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-25 16:07:24 -04:00
Sebastiaan van Stijn
15a59e763b
Bump API version to 1.33
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-20 15:19:16 +02:00
Akash Gupta
7a7357dae1 LCOW: Implemented support for docker cp + build
This enables docker cp and ADD/COPY docker build support for LCOW.
Originally, the graphdriver.Get() interface returned a local path
to the container root filesystem. This does not work for LCOW, so
the Get() method now returns an interface that LCOW implements to
support copying to and from the container.

Signed-off-by: Akash Gupta <akagup@microsoft.com>
2017-09-14 12:07:52 -07:00
Yong Tang
dc35a8a5d2 Merge pull request #34821 from thaJeztah/remove-enable-api-cors
Remove deprecated --enable-api-cors flag
2017-09-13 20:10:27 -07:00
Sebastiaan van Stijn
80edccda70 Merge pull request #34828 from allencloud/add-config-tags-in-swagger
add configs tag in swagger.yml
2017-09-14 02:37:28 +02:00
Allen Sun
16929d337a add configs tag in swagger.yml
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
2017-09-13 09:48:05 +08:00
Daniel Nephin
f7f101d57e Add gosimple linter
Update gometalinter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-12 12:09:59 -04:00
Sebastiaan van Stijn
7d4eab5543
Remove deprecated --enable-api-cors flag
The `--enable-api-cors` flag was deprecated in f3dd2db4ff,
and marked for removal in docker 17.09 through 85f92ef359.

This patch removes the deprecated flag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-09-12 12:43:34 +02:00
Brian Goff
c8400bf24d Merge pull request #34756 from dnephin/better-filters
Improve docs and interface for api/types/filters
2017-09-07 17:00:59 -04:00
Yong Tang
2dcb77b24c Merge pull request #34738 from wgliang/optimization1
Optimize some wrong usage and spelling
2017-09-07 09:45:14 -07:00
wangguoliang
94cefa2145 Optimize some wrong usage and spelling
Signed-off-by: wgliang <liangcszzu@163.com>
2017-09-07 09:44:08 +08:00
Daniel Nephin
065118390a Cleanup filter package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-06 16:41:47 -04:00
Daniel Nephin
2f007e46d0 Remove libtrust dep from api
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-06 12:05:19 -04:00
Daniel Nephin
22b246417f Move names to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-09-06 12:05:16 -04:00
Daniel Nephin
2f5f0af3fd Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-24 15:08:31 -04:00
Daniel Nephin
709bf8b7bc Add interfacer linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-24 15:08:26 -04:00
Yong Tang
6540d55814 Merge pull request #34588 from dnephin/more-linters
Add deadcode and goimports linters
2017-08-22 05:12:50 -07:00
Yong Tang
28362f11d7 Merge pull request #34572 from krizalys/hyphenless-bind-mount
Dropped hyphen in bind mount where appropriate
2017-08-22 05:11:46 -07:00
Daniel Nephin
62c1f0ef41 Add deadcode linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-21 18:18:50 -04:00
Christophe Vidal
dffa5d6df2 Dropped hyphen in bind mount where appropriate
Signed-off-by: Christophe Vidal <kriss@krizalys.com>
2017-08-19 21:25:07 +07:00
Daniel Nephin
9b47b7b151 Fix golint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-18 14:23:44 -04:00
Yong Tang
2afb3efaa6 Merge pull request #34188 from cpuguy83/32144_api_error_handling
Remove string checking in API error handling
2017-08-16 08:53:15 -07:00
Sebastiaan van Stijn
18b23067be
Create definition for SystemInfo response
The `/info` endpoint was badly documented, missing various
fields and incorrectly describing others.

This patch defines a type for the endpoint, based on the
API types in the source.

Also removing the response example in favor of
per-field examples, as this prevents an incorrectly
formatted response from masking omissions in the
actual type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:11:29 +02:00
Sebastiaan van Stijn
2720cefbb2
Remove redundant example for Node
All example values are now documented per field,
so are automatically used to generate responses.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:11:19 +02:00
Sebastiaan van Stijn
5b017ef45d
Add definition for Swarm inspect response
Also remove inline response examples

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:11:14 +02:00
Sebastiaan van Stijn
33e2c99401
Extract NodeDescription to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:11:09 +02:00
Sebastiaan van Stijn
7cb4a97ae1
Extract EngineDescription to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:11:04 +02:00
Sebastiaan van Stijn
a2de2681a6
Extract Platform to a separate definition
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:58 +02:00
Sebastiaan van Stijn
3f1ad79faf
Add missing definition for Node.ManagerStatus
The `Node.ManagerStatus`  property was only present in
the example, but not in the definition.

This patch adds definitions for `ManagerStatus`
and `Reachability`, similar to what is used in the
code;
f02a5b50c4/api/types/swarm/node.go (L84-L101)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:53 +02:00
Sebastiaan van Stijn
26b247e706
Add missing definition for Node.Status
The `Node.Status`  property was only present in
the example, but not in the definition.

This patch adds definitions for `NodeStatus`
and `NodeState`, similar to what is used in the
code;

- f02a5b50c4/api/types/swarm/node.go (L77-L82)
- f02a5b50c4/api/types/swarm/node.go (L103-L115)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:47 +02:00
Sebastiaan van Stijn
b2de157a41
Fix TLSInfo in Node specification
- `TLSInfo` is part of `Node.Description`, but was documented as a
  direct child of `Node`
- `Node.TLSInfo` incorrectly was using the `SwarmSpec` type,
  instead of `TLSInfo`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:42 +02:00
Sebastiaan van Stijn
93e324e2a7
Update incorrect types in Swagger
- `ObjectVersion.Index` is an `uint64` 0fd90c4d5d/api/types/swarm/common.go (L5-L15)
- `ClusterInfo` is nullable in the `/info` output (see ff4f700f74/api/types/swarm/swarm.go (L203))
- `CAConfig.ForceRotate` was missing a type, therefore treated as an `object` in Swagger: ff4f700f74/api/types/swarm/swarm.go (L121)
- `Raft.SnapshotInterval`, `Raft.KeepOldSnapshots`, and `Raft.LogEntriesForSlowFollowers` are an `uint64` not an `int64`
- Various fields in `swarm.Info` are nullable; added `x-nullable`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:32 +02:00
Sebastiaan van Stijn
934378bee3
Update / add extra description fields to Swagger
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:27 +02:00
Sebastiaan van Stijn
fa05a53426
Add extra example values to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:22 +02:00
Sebastiaan van Stijn
f720f9cc33
Reformat definitions - add some whitespace
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-16 11:10:14 +02:00
Brian Goff
ebcb7d6b40 Remove string checking in API error handling
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-08-15 16:01:11 -04:00
Sebastiaan van Stijn
b98ceb7121
Update NetworkConfig definition in Swagger
This patch updates the definition of `NetworkConfig` to match the code, and
renames to the definition to `NetworkSettings` (also to match the type in
the code).

Add definitions for:

- `Address`
- `PortMap`
- `PortBinding`
- `EndpointIPAMConfig`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-15 09:39:41 +02:00
Kir Kolyshkin
7120976d74 Implement none, private, and shareable ipc modes
Since the commit d88fe447df ("Add support for sharing /dev/shm/ and
/dev/mqueue between containers") container's /dev/shm is mounted on the
host first, then bind-mounted inside the container. This is done that
way in order to be able to share this container's IPC namespace
(and the /dev/shm mount point) with another container.

Unfortunately, this functionality breaks container checkpoint/restore
(even if IPC is not shared). Since /dev/shm is an external mount, its
contents is not saved by `criu checkpoint`, and so upon restore any
application that tries to access data under /dev/shm is severily
disappointed (which usually results in a fatal crash).

This commit solves the issue by introducing new IPC modes for containers
(in addition to 'host' and 'container:ID'). The new modes are:

 - 'shareable':	enables sharing this container's IPC with others
		(this used to be the implicit default);

 - 'private':	disables sharing this container's IPC.

In 'private' mode, container's /dev/shm is truly mounted inside the
container, without any bind-mounting from the host, which solves the
issue.

While at it, let's also implement 'none' mode. The motivation, as
eloquently put by Justin Cormack, is:

> I wondered a while back about having a none shm mode, as currently it is
> not possible to have a totally unwriteable container as there is always
> a /dev/shm writeable mount. It is a bit of a niche case (and clearly
> should never be allowed to be daemon default) but it would be trivial to
> add now so maybe we should...

...so here's yet yet another mode:

 - 'none':	no /dev/shm mount inside the container (though it still
		has its own private IPC namespace).

Now, to ultimately solve the abovementioned checkpoint/restore issue, we'd
need to make 'private' the default mode, but unfortunately it breaks the
backward compatibility. So, let's make the default container IPC mode
per-daemon configurable (with the built-in default set to 'shareable'
for now). The default can be changed either via a daemon CLI option
(--default-shm-mode) or a daemon.json configuration file parameter
of the same name.

Note one can only set either 'shareable' or 'private' IPC modes as a
daemon default (i.e. in this context 'host', 'container', or 'none'
do not make much sense).

Some other changes this patch introduces are:

1. A mount for /dev/shm is added to default OCI Linux spec.

2. IpcMode.Valid() is simplified to remove duplicated code that parsed
   'container:ID' form. Note the old version used to check that ID does
   not contain a semicolon -- this is no longer the case (tests are
   modified accordingly). The motivation is we should either do a
   proper check for container ID validity, or don't check it at all
   (since it is checked in other places anyway). I chose the latter.

3. IpcMode.Container() is modified to not return container ID if the
   mode value does not start with "container:", unifying the check to
   be the same as in IpcMode.IsContainer().

3. IPC mode unit tests (runconfig/hostconfig_test.go) are modified
   to add checks for newly added values.

[v2: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-51345997]
[v3: addressed review at https://github.com/moby/moby/pull/34087#pullrequestreview-53902833]
[v4: addressed the case of upgrading from older daemon, in this case
     container.HostConfig.IpcMode is unset and this is valid]
[v5: document old and new IpcMode values in api/swagger.yaml]
[v6: add the 'none' mode, changelog entry to docs/api/version-history.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-08-14 10:50:39 +03:00
Victor Vieux
4930020210 hide swarm plugins behind experimental flag
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-08-08 18:33:25 -07:00
John Starks
54354db850 Windows: Add named pipe mount support
Current insider builds of Windows have support for mounting individual
named pipe servers from the host to the guest. This allows, for example,
exposing the docker engine's named pipe to a container.

This change allows the user to request such a mount via the normal bind
mount syntax in the CLI:

  docker run -v \\.\pipe\docker_engine:\\.\pipe\docker_engine <args>

Signed-off-by: John Starks <jostarks@microsoft.com>
2017-08-07 11:34:36 -07:00
Alessandro Boch
beebfc0cf6 Fix api server null pointer def on inspect/ls null ipam-driver networks
- When a network is created with the null ipam driver, docker api server
  thread will deference a nil pointer on `docker network ls` and on
  `docker network inspect <nw>`. This because buildIpamResource()
  assumes a gateway address is always present, which is not correct.

Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
2017-08-03 13:35:58 -07:00
John Howard
8af4db6f00 Merge pull request #34272 from dmcgowan/update-logrus
Update logrus to v1.0.1 (Sirupsen -> sirupsen)
2017-08-01 18:53:33 -07:00
Sebastiaan van Stijn
1a0fbc4a6f Merge pull request #34287 from thaJeztah/bump-api-version
Bump API version to 1.32
2017-08-01 12:18:26 +02:00
Vincent Demeester
0fd90c4d5d Merge pull request #34202 from thaJeztah/swagger-external-secrets-store
Add API documentation for plugable secret backends
2017-08-01 10:59:08 +02:00
Victor Vieux
3364e7da3f Merge pull request #34302 from abhinandanpb/predefinednet
Changing the get network request to return swarm scope predefined net…
2017-07-31 17:08:04 -07:00
Derek McGowan
1009e6a40b
Update logrus to v1.0.1
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-31 13:16:46 -07:00
Abhinandan Prativadi
5bfefb2d36 Changing the get network request to return swarm scope predefined networks
Starting 17.06 swarm service create supports service creates with predefined
networks like host and bridge. Due to the nature of the feature, swarm manager
has a swarm scope predefined networks in addition to local scoped
predefined networks on all nodes. However network inspects for swarm scoped
predefined networks was not possible. The fix adds support for network inspect
for swarm scoped predefined networks.

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-07-31 13:05:30 -07:00
Sebastiaan van Stijn
c8dad44c32
Add API documentation for plugable secret backends
Documents the API changes introduced in

0304c98d85 and
08f7cf0526

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-28 00:00:53 +02:00
Sebastiaan van Stijn
05121d5554
Bump API version to 1.32
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-27 18:50:31 +02:00
Sebastiaan van Stijn
4735c76632
Update API plugin response examples
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-27 18:43:13 +02:00
Sebastiaan van Stijn
36e4e952f8 Merge pull request #34247 from thaJeztah/fix-restartpolicy-default
Fix RestartPolicy default value
2017-07-27 00:21:48 +02:00
Brian Goff
1ea52c4812 Merge pull request #34249 from thaJeztah/remove-unused-constants
Remove unused constants in plugin_responses
2017-07-26 16:44:51 -04:00
Brian Goff
9319a8a2dd Merge pull request #33440 from RenaudWasTaken/genericresource
Added support for Generic Resources
2017-07-25 15:32:25 -04:00
Sebastiaan van Stijn
9bb57aa3fe
Remove unused constants in plugin_responses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-25 17:07:04 +02:00
Sebastiaan van Stijn
fc48b5529d
Fix RestartPolicy default value
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-25 16:14:59 +02:00