Commit Graph

896 Commits

Author SHA1 Message Date
ac33a30857 Merge pull request #32015 from dperny/service-logs-support-task-logs
Add Support for Service Task Logs
Upstream-commit: 170be9c26745b953dbfc5cafdc63eb3895c2c541
Component: engine
2017-04-04 00:15:13 -07:00
93e346635c Add support for task and arbitrary combo logs
Refactored the API to more easily accept new endpoints. Added REST,
client, and CLI endpoints for getting logs from a specific task. All
that is needed after this commit to enable arbitrary service log
selectors is a REST endpoint and handler.

Task logs can be retrieved by putting in a task ID at the CLI instead of
a service ID.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: d330dc3223df7e6c2b066373718709e34e19efca
Component: engine
2017-04-03 18:40:54 -07:00
694fa58dc1 Merge pull request #31889 from cpuguy83/all_the_pprof
Use generic handler for pprof profile lookups
Upstream-commit: 022552ac873939db018722cb4a2e8289c6927e5e
Component: engine
2017-04-03 15:14:12 +02:00
d79afa43f8 Allow user to modify ingress network
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: d59d19c32818ed73cc6b4d153f2858c4fe97f50e
Component: engine
2017-03-26 15:46:18 -07:00
d918c4ba81 Add --filter scope=swarm|local for docker network ls
This fix tries to address the request in 31324 by adding
`--filter scope=swarm|local` for `docker network ls`.

As `docker network ls` has a `SCOPE` column by default,
it is natural to add the support of `--filter scope=swarm|local`.

This fix adds the `scope=swarm|local` support for
`docker network ls --filter`.

Related docs has been updated.

Additional unit test cases have been added.

This fix fixes 31324.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 704ea8f6b4ad6f43c348affe357994d440aaf3de
Component: engine
2017-03-23 18:48:11 -07:00
edcb2d10ec Use generic handler for pprof profile lookups
This more (in spirit) mimics the handler usage in net/http/pprof.
It also makes sure that any new profiles that are added are
automatically supported (e.g. `mutex` profiles in go1.8).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a1b06933aff80763ec62a288d5178a4321be1baa
Component: engine
2017-03-16 11:05:20 -04:00
57ff68893d Replace API version comparison by a if
… as we don't know for sure what API version it will be at that time.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0f9d22cd66353b3d14dd4a08084f88778fb69480
Component: engine
2017-03-15 10:46:06 +01:00
9aea8ad976 bump API to 1.28
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: cd173a603003f3b15f4bae13e2e27b7ee1a46942
Component: engine
2017-03-14 09:32:50 -07:00
95794e3edc Merge pull request #31710 from sanimej/drillerrr
Add verbose flag to network inspect to show all services & tasks in swarm mode
Upstream-commit: cdf66ba715c573f85338a2b2a432db6cb9a48e6d
Component: engine
2017-03-13 21:12:32 -07:00
ff11389227 Enhance network inspect to show all tasks, local & non-local, in swarm mode
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Upstream-commit: 14f76a21db71c5a817cb4d1e27f9940cefd5c820
Component: engine
2017-03-13 17:52:08 -07:00
da38e7fbf1 Hide command options that are related to Windows
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Upstream-commit: 7199522ea2e77c77bf931474eca92aa502ce0031
Component: engine
2017-03-12 08:47:17 +02:00
d82df5d4ba Implement server-side rollback, for daemon versions that support this
Server-side rollback can take advantage of the rollback-specific update
parameters, instead of being treated as a normal update that happens to
go back to a previous version of the spec.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: f9bd8ec8b268581f93095c5a80679f0a8ff498bf
Component: engine
2017-03-03 16:33:34 -08:00
c09eedcd69 Merge pull request #30265 from allencloud/add-CheckDuplicate-details-and-logic
add CheckDuplicate docs and logics in network
Upstream-commit: e1da516598e6f4e8f58964fce62ff13be1d8cc09
Component: engine
2017-03-03 14:18:52 +01:00
0b5c58f653 fix func name "BuildFromContext" in comment
Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
Upstream-commit: d37df06ebead733a10ebbff2b5e7a45003b6fac6
Component: engine
2017-03-02 17:00:40 +08:00
12aa0347d6 Merge pull request #30383 from TDAbboud/30096-add-host-docker-build
Add --add-host for docker build
Upstream-commit: a64ea37753fd9a94dfa3ab81f67f46df7bd641f8
Component: engine
2017-02-27 12:42:18 +01:00
9632b0f1e8 use t.Fatal() to output the err message where the values used for formatting
text does not appear to contain a placeholder

Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
Upstream-commit: 2a8d6368d4a930203b93f75914173ab65bf3b0bc
Component: engine
2017-02-23 10:16:22 +08:00
1483bc0c6d Merge pull request #31164 from vieux/missing_api_changes
add missing API changes
Upstream-commit: f10085165a42dc93b6180e0e5478f71c1c614126
Component: engine
2017-02-20 15:42:19 -08:00
7dba33b4e7 Add --add-host for docker build
Signed-off-by: Tony Abboud <tdabboud@hotmail.com>
Upstream-commit: 7a962e4577628c357f96153eca07e527813fb42b
Component: engine
2017-02-20 17:32:28 -05:00
6446421ffd add missing API changes
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: a7e6d2ca1fd30a6122a65558507135e7079ae6a7
Component: engine
2017-02-19 01:33:43 -08:00
999e2c3104 fix status-code for "locked" swarm and "certificate expired"
These errors were producing the wrong status code,
changing to 503.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7e44fffe40f39ef4cc0b3bee810f7d0a26136376
Component: engine
2017-02-17 16:51:50 -08:00
e4c1cbaa7f Merge pull request #30809 from fate-grand-order/branch
Correct fmt.Fprintf and t.Fatalf
Upstream-commit: a2106c8224b9b6224b41eb4221a96a29c1237545
Component: engine
2017-02-16 23:02:03 -05:00
f9c823322f fix docker logs error handling
Previously, `docker logs` (and by extension, `docker service logs`) had
an error in the way they returned errors that occurred after a stream
had already been started. Specifically, the errors were added verbatim
to the HTTP response, which caused StdCopy to fail with an esoteric
error. This change updates StdCopy to accept errors from the source
stream and then return those errors when copying to the destination
stream.

Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: f19b0d72d1234c2bf4d85f7c1a4916b7b85b97b0
Component: engine
2017-02-14 14:38:42 -08:00
6aa42ecc9e add CheckDuplicate docs and logics in network
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 94b880f919937b3995a3424a284d1f6769e60f4b
Component: engine
2017-02-13 00:34:40 +08:00
a02b030327 Fix #303111: dockerd leaks ExecIds on failed exec -i
Signed-off-by: Dmitry Shyshkin <dmitry@shyshkin.org.ua>
Upstream-commit: 3cc0d6bb0475551687d89e7925b09f864c866a71
Component: engine
2017-02-10 21:13:00 +02:00
cde9376903 Correct fmt.Fprintf and t.Fatalf
Signed-off-by: Helen Xie <chenjg@harmonycloud.cn>
Upstream-commit: 921002137aa877fc4730fefbd5d918adacb7adde
Component: engine
2017-02-08 12:32:40 +08:00
c9ee5a3f47 Return error in case docker network inspect is ambiguous
This fix is partially based on comment
https://github.com/docker/docker/issues/30242#issuecomment-273517205

Currently, `docker network inspect` relies on `FindNetwork()` which
does not take into consideration that multiple networks with the same
name might exist.

This fix propose to return `docker network inspect` in a similiar
fashion like other commands:
1. Lookup full ID
2. Lookup full name
3. Lookup partial ID
If multiple networks exist, an error will be returned.

NOTE: this fix is not a complete fix for the issue raised in
https://github.com/docker/docker/issues/30242#issuecomment-273517205
where SwarmKit is unable to update when multiple networks with the same
name exit.
To fix that issue requires multiple places when `FindNetwork()` is called.
Because of the impact of changing `FindNetwork()`, this fix focus on
the issue in `docker network inspect`.

A separate PR will be created to address
https://github.com/docker/docker/issues/30242#issuecomment-273517205

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: abf31ee0837ff80638f10b77df9025b6b6470253
Component: engine
2017-02-07 18:05:29 -08:00
c355cec53c Merge pull request #30457 from dmcgowan/distribution-reference-update-2
reference: use distribution reference and remove fork
Upstream-commit: 254fc83cba90ed79c78f4cb0cb33aeeaff492798
Component: engine
2017-02-07 22:01:25 +01:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
5a2fed241e fix some types on errors and form
Signed-off-by: kaiwentan <kaiwentan@harmonycloud.cn>
Upstream-commit: ac9c47e26f57a0fa2fed95a1fb1bf6c9410a3b60
Component: engine
2017-02-07 20:29:32 +08:00
0ff5a04abc Show stacktrace in daemon logs only if 500 internal error
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f7d9bb62483fa160553ef17840b1f974b12885ac
Component: engine
2017-02-06 10:13:21 -08:00
7b0b9f56f9 Merge pull request #30673 from mavenugo/nr
List Networks need not pull all the endpoints
Upstream-commit: 4dbc105fc1dc572577f48a69fcecc475ba81b576
Component: engine
2017-02-03 19:09:43 -08:00
28da29ca6e Add docker plugin upgrade
This allows a plugin to be upgraded without requiring to
uninstall/reinstall a plugin.
Since plugin resources (e.g. volumes) are tied to a plugin ID, this is
important to ensure resources aren't lost.

The plugin must be disabled while upgrading (errors out if enabled).
This does not add any convenience flags for automatically
disabling/re-enabling the plugin during before/after upgrade.

Since an upgrade may change requested permissions, the user is required
to accept permissions just like `docker plugin install`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 03c694973968f63743ed53cef83d0b7455695081
Component: engine
2017-02-03 16:21:12 -05:00
5c3503d315 List Networks need not pull all the endpoints
Pulling all the endpoints is a very resource heavy operation especially
for Global-scoped networks with a backing KVStore. Such heavy operations
can be fetched for individual network inspect. These are unneccessary
for a simple network list operation.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: f388b7aa8af84e39347cde70691130c9417377b8
Component: engine
2017-02-02 20:19:58 -08:00
9447ebbb9d Merge pull request #30460 from yongtang/28176-attach-binary-frame-websocket
Use binary frame for websocket attach endpoint
Upstream-commit: f0089a85ecba6a31c6e00b038b18096080e516ea
Component: engine
2017-02-01 20:02:46 -08:00
9655371ac7 Merge pull request #28627 from yongtang/28624-docker-plugin-ls
Add `--filter enabled=true` for `docker plugin ls`
Upstream-commit: 4c1b40b9d4a301edc5874e59edcec0f015490fec
Component: engine
2017-02-01 16:52:00 +01:00
83cd2e6903 plugin: use pkg/errors in more places
Also provide stack trace output in daemon logs.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 26d0bac8955903bc3a845358d159b2ec2f7c253f
Component: engine
2017-01-31 16:45:26 -08:00
b0eb082cb1 Use binary frame for websocket attach endpoint
This fix tries to address the issue raised in 28176 where
text frame was used in websocket attach endpoint. In case
the data send out contains non utf8 data, the connection
will be closed in certain browsers, e.g., Safari.

This fix address the issue by change `PayloadType` to `BinaryFrame`.

This fix is tested manually with Safari. The docker daemon is inside a Linux Virtual Machine.

Create a container with:
```
docker run -itd --name websocket busybox sh -c "while true; do echo -e 'he\\xc3\\x28o'; sleep 5; done"
```

Use the following url (172.16.66.128:2375 is the tcp address of the daemon):
```
file:///websocket.html?url=ws://172.16.66.128:2375/v1.25/containers/websocket/attach/ws?logs=1&stderr=1&stdout=1&stream=1&stdin=1
```

and the following html:
```
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Websocket</title>
  <script type="text/javascript">
    function DockerWebSocket() {
      if ("WebSocket" in window) {
        console.log("WebSocket is supported by Browser...")
        // Remove '?url=' prefix
        url = window.location.search.replace(/^(\?url=)/,"");
        console.log("URL ["+url+"]...");
        var ws = new WebSocket(url);
        ws.onopen = function() {
          console.log("Connection is opened...");
        };
        ws.onclose = function() {
          console.log("Connection is closed...");
        };
        ws.onmessage = function (e) {
          if (typeof e.data === "string") {
            alert("WebSocket received text message ["+e.data+"]!")
          } else {
            console.log("Message is received...")
            var blobReader = new FileReader();
            blobReader.onload = function(event) {
              console.log(JSON.stringify(blobReader.result))
            };
            blobReader.readAsText(e.data)
            console.log("Message complete...")
          }
        };
      } else {
        alert("WebSocket is not supported by Browser!");
      }
    }
  </script>
</head>
<body>
  <div>
    <a href="javascript:DockerWebSocket()">Run DockerWebSocket</a>
  </div>
</body>
</html>
```

This fix fixes 28176.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e82dcaab520cb5676091f31d90614d3988a725e4
Component: engine
2017-01-31 14:04:32 -08:00
947241845a Add --filter enabled=true for docker plugin ls
This fix adds `--filter enabled=true` to `docker plugin ls`,
as was specified in 28624.

The related API and docs has been updated.

An integration test has been added.

This fix fixes 28624.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a66e0dc349dad2d45685846a95fe1d6da967a46d
Component: engine
2017-01-26 13:16:11 -08:00
bc911a640c Merge pull request #28409 from dnephin/swagger-gen-more
Generate more types from the swagger spec
Upstream-commit: a69c4129e086e4e7b86cce7d2682685dfdc6f2d2
Component: engine
2017-01-26 10:35:34 -08:00
a818254bf8 Fix incorrect Scope in network ls/inspect with duplicate network names
This fix tries to address the issue raised in 30242 where the `Scope`
field always changed to `swarm` in the ouput of `docker network ls/inspect`
when duplicate networks name exist.

The reason for the issue was that `buildNetworkResource()` use network name
(which may not be unique) to check for the scope.

This fix fixes the issue by always use network ID in `buildNetworkResource()`.

A test has been added. The test fails before the fix and passes after the fix.

This fix fixes 30242.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 05a831a775be5e8d752deaef620e629deb15cb89
Component: engine
2017-01-25 09:39:55 -08:00
c28bd5178d Merge pull request #29965 from yongtang/29946-networks-api
Return `[]` instead of `null` in case `filterNetworks` returns empty
Upstream-commit: f19a293dd741583c66001799435f784f2af455e0
Component: engine
2017-01-17 18:58:35 +01:00
c249c5ced8 Don't use AutoRemove on older daemons
Docker 1.13 moves the `--rm` flag to the daemon,
through an AutoRemove option in HostConfig.

When using API 1.24 and under, AutoRemove should not be
used, even if the daemon is version 1.13 or above and
"supports" this feature.

This patch fixes a situation where an 1.13 client,
talking to an 1.13 daemon, but using the 1.24 API
version, still set the AutoRemove property.

As a result, both the client _and_ the daemon
were attempting to remove the container, resulting
in an error:

    ERRO[0000] error removing container: Error response from daemon:
    removal of container ce0976ad22495c7cbe9487752ea32721a282164862db036b2f3377bd07461c3a
    is already in progress

In addition, the validation of conflicting options
is moved from `docker run` to `opts.parse()`, so
that conflicting options are also detected when
running `docker create` and `docker start` separately.

To resolve the issue, the `AutoRemove` option is now
always set to `false` both by the client and the
daemon, if API version 1.24 or under is used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 0ea7b143b0a8366799c83a955be676aaf1345214
Component: engine
2017-01-15 01:59:57 +01:00
6fcadc8e19 Return [] instead of null in case filterNetworks returns empty
This fix tries to address the issue raised in 29946 where
listing networks from API will return `null` if the result of
network filter is empty.

The reason for the issue was that inside the `filterNetworks()`,
the return value was initialized as `nil`:
```
 var typeNet []types.NetworkResource
```

This is inconsistent with other places where return value was
initialized with `[]`
```
displayNet := []types.NetworkResource{}
```

This fix addresses the issue by changing `typeNet` to `[]` as well.

This fix fixes 29946.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 6ae709bf10e97c0a0ad8aebb9075f59eaea97ba9
Component: engine
2017-01-11 01:56:11 -08:00
0c3b3bfadc Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment
https://github.com/docker/docker/pull/28535#issuecomment-263215225

This fix provides `--filter until=<timestamp>` for `docker container/image prune`.

This fix adds `--filter until=<timestamp>` to `docker container/image prune`
so that it is possible to specify a timestamp and prune those containers/images
that are earlier than the timestamp.

Related docs has been updated

Several integration tests have been added to cover changes.

This fix fixes #28497.

This fix is related to #28535.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 58738cdee327f5de481dcf7d3d377374cbb5f13a
Component: engine
2017-01-04 14:16:42 -08:00
f43a9bc718 Convert ContainerTopOKResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 16bdbaaa3357dc1be7d74a283a3ed8d0d861a461
Component: engine
2017-01-03 11:47:47 -05:00
c049133b66 Generate ImageDeleteResponse from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 5988b84e4fd9a512e3e8f98b3cfd7c030a4f013e
Component: engine
2017-01-03 11:47:47 -05:00
0a6e02b356 Generate ImageHistory from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b462c93edb44790ca309e3721950cb23be5d7d62
Component: engine
2017-01-03 11:47:44 -05:00
6b3d2b6135 Merge pull request #28631 from likel/master
Don't do format if it's unnecessary
Upstream-commit: d6be0e98027611cfb14a3246ca797bee0936e649
Component: engine
2016-12-30 01:13:12 +01:00
82cdad076c fail fast when network filter invalid
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: ee2925e2f970a83581aadd08704b117b09377d23
Component: engine
2016-12-29 17:34:53 +08:00
96e9f269ff Merge pull request #29666 from tonistiigi/client-deps
Clean up client binary dependencies
Upstream-commit: bf6eb855391e166a65db284567686fafbe4a9a0a
Component: engine
2016-12-27 15:01:24 -05:00