Commit Graph

3500 Commits

Author SHA1 Message Date
Aaron Lehmann 5d7a3f7b5f Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 2cc5bd33eef038bf5721582e2410ba459bb656e9)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:59 -07:00
Drew Erny fd231567dc Added leader election test
Signed-off-by: Drew Erny <drew.erny@docker.com>
(cherry picked from commit 3489e76513b76e6429075dbbcb6acb3341e42293)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:16:14 -07:00
Yong Tang 06f8cd5f31 Allow partial name match for `node ls`, and `node tasks`
This fix is an extension to last commit to expand the partial
filter to node and task searches.

Additional integration tests have been added to cover the changes.

This fix fixes 24270.
This fix fixes 24112.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit e734fa58eadb4dfaa33b4be275d6f8f29d899e78)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Yong Tang 7ebba69c43 Allow partial name match for `service ls --filter`
This fix tries to address the issue raised in 24270 where it was
not possible to have a partial name match when list services
with name filter.

This fix updates swarmkit and allows prefix search when name is
provided as the filter for listing services.

An additional integration test is added to cover the changes.

This fix fixes 24270.

Note: A separate pull request will be opened on swarmkit.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 1d600ebcb5750c4c93356fae08e562d836ecee45)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:45 -07:00
Dong Chen 61936227d0 Test rolling update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
(cherry picked from commit d327765a62a99dc63e9a8c16ac291861cee066f3)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:43 -07:00
Kenfe-Mickael Laventure b7687cc673 Do not rely on "live" event anymore
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 64483c3bdaa1887b8b932e0564362fbbff025dc0)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:42 -07:00
Anusha Ragunathan da773af885 Print plugin name on successful install, enable and disable.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 6dca1e6d3f875de7a6652390f65fdb8ec2623e3b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Anusha Ragunathan c04c127ce3 Remove use of exec-root in plugins due to socket pathname limits.
Unix sockets are limited to 108 bytes. As a result, we need to be
careful in not using exec-root as the parent directory for pluginID
(which is already 64 bytes), since it can result in socket path names
longer than 108 bytes. Use /tmp instead. Before this change, setting:
- dockerd --exec-root=/go/src/github.com/do passes
- dockerd --exec-root=/go/src/github.com/doc fails
After this change, there's no failure.

Also, write a volume plugins test to verify that the plugins socket
responds.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 21ecd5a93db34288c0c579d5738030716d7bef2d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:25 -07:00
Tonis Tiigi 211f871092 Fix panic in stats test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f5fb3c69fdd339c4ec1778a00d4cfc1aa887e310)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:15:11 -07:00
Daniel Nephin fad55b0ea1 Change the add/update flags to include 'add'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit 4c6faa434071b87a55256e86020cb78495e9951d)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Daniel Nephin b5f1b77a23 Add remove flags for service update
with unit tests

Signed-off-by: Daniel Nephin <dnephin@docker.com>
(cherry picked from commit dc33fc1ff433fcc70efc22f5cea9b87c6ec64a3b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-25 23:14:59 -07:00
Arnaud Porterie (icecrime) c61fa33c23 Rename `--net` to `--network`
Add a `--network` flag which replaces `--net` without deprecating it
yet. The `--net` flag remains hidden and supported.

Add a `--network-alias` flag which replaces `--net-alias` without deprecating
it yet. The `--net-alias` flag remains hidden and supported.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
(cherry picked from commit c0c7d5e71586ec8e4d54aef9e061f061e9223cc4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:38 -07:00
Alexander Morozov eaa8821a23 integration-cli: add test for restarting entire swarm cluster
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
(cherry picked from commit ae4137ae3cc6ee479f5e7f86f9859b485473285a)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Ralf Sippl 909e7a2ca5 Add API test for empty services list
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
(cherry picked from commit 65e72133a11ea3e6873f62039956bbd70548a5a7)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:37 -07:00
Tonis Tiigi 56ab840f37 Use waitAndAssert to test node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit f02ec39e99bfd36f34a965f78d853e19234e513b)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:21 -07:00
Anusha Ragunathan db94be5084 Shutdown plugins during daemon shutdown.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 863ab9ab134d0baef3c7e5d745eded891e87e734)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:21 -07:00
Qiang Huang 88d82eee4b Remove execution driver
We use containerd and there is no execution driver anymore.

Addresses: https://github.com/docker/docker/issues/24461

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
(cherry picked from commit 1fb1136fecfd761300a38f64ac9178979cc0b270)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:50:18 -07:00
allencloud 25b235a1b1 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
(cherry picked from commit 416613f2e54581c62d3efa1c4f0288b6e7d58365)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:39 -07:00
Antonio Murdaca e76138c35f integration-cli: fix --net=none tests
Example:

21:28:01 [d68573521] waiting for daemon to start
21:28:01 [d68573521] daemon started
21:28:01 docker_api_swarm_test.go:163:
21:28:01     c.Assert(d1.Init(map[string]bool{"worker": true}, ""),
checker.IsNil)
21:28:01 ... value *errors.errorString =
&errors.errorString{s:"initializing swarm: invalid statuscode 500,
\"{\\\"message\\\":\\\"could not determine local IP address: dial udp
8.8.8.8:53: connect: network is unreachable\\\"}\\n\"} ("initializing
swarm: invalid statuscode 500, \"{\\\"message\\\":\\\"could not
determine local IP address: dial udp 8.8.8.8:53: connect: network is
unreachable\\\"}\\n\"")
21:28:01
21:28:01 [d68573521] exiting daemon"}

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit 9fadb8fd6a09c8982dc8a44125f4d21c33c8c394)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Tonis Tiigi b008283a7f Add more complicated demotion testcases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit a3f1577365f7b2ed99d1801c909bfaa69c048c92)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-12 15:43:38 -07:00
Justin Cormack a654ab1e89 Fix test case for docker_api_swarm_test.go
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
(cherry picked from commit 6dfba780cc490ef7579e95169b5c71617f8e5a47)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:28 -07:00
Aaron Lehmann a00d12a8dd Generate a swarm joining secret if none is specified
The current behavior of `docker swarm init` is to set up a swarm that
has no secret for joining, and does not require manual acceptance for
workers. Since workers may sometimes receive sensitive data such as pull
credentials, it makes sense to harden the defaults.

This change makes `docker swarm init` generate a random secret if none
is provided, and print it to the terminal. This secret will be needed to
join workers or managers to the swarm. In addition to improving access
control to the cluster, this setup removes an avenue for
denial-of-service attacks, since the secret is necessary to even create
an entry in the node list.

`docker swarm init --secret ""` will set up a swarm without a secret,
matching the old behavior. `docker swarm update --secret ""` removes the
automatically generated secret after `docker swarm init`.

Closes #23785

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 7342e42fcecbc243bcb8723b8422879662452017)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:33:27 -07:00
Anusha Ragunathan 61dc82f423 Detect non-plugin content during install and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit d32df6d934875052232bbbc49fa473bd283af6e4)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:34 -07:00
Brian Goff 843b4a93fe Use newer default values for mounts CLI
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 56f3422468a0b43da7bae7a01762ce4f0a92d9ff)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:30 -07:00
Brian Goff 85aefec45a Implement service integration tests
This is done in a hacky way as currently there is no better way.
Uses known implementation details about how tasks are scheduled to be
able to operate on the underlying container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e5ec575b32d6979914dce576f1b8bb71f3057cea)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Antonio Murdaca 3bf23479cf integration-cli: ensure digest is the same after cross-repo push
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
(cherry picked from commit a0c8970df1f013a51684f82dd86815dcf773a250)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:22 -07:00
Derek McGowan dd7fe47136 Treat digest only images as dangling
Add test for dangling digest images

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 8906f8307c86ce59f51d2f1b750f5e698f3cf8a5)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Derek McGowan d81ed3eb4c Always store the image digest when pulling and pushing an image.
Always attempt to add digest even when tag already exists.
Ensure digest does not currently exist.
When image id is mismatched, output an error log.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 33984f256b1a281b1130ac7e8edb7bc311750ccf)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:14 -07:00
Lei Jitang 9d4117ae18 Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
schema1 manifests is not working on ARM64, we should skip integration-cli
tests for schema1 manifests on ARM64.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 9c1566a1dfa3eccd12e09a3e2cbda60503600d44)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:32:13 -07:00
Lei Jitang a8bd5c65cc Add fchmod and fchmodat to TestRunSeccompProfileDenyChmod
Signed-off-by: Lei Jitang <leijitang@huawei.com>
(cherry picked from commit 8c179348c31392559d95481b47625769a7620a21)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:44 -07:00
Otto Kekäläinen 664c75ebba Fix spelling in comments, strings and documentation
Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
(cherry picked from commit 644a7426cc31c338fedb6574d2b88d1cc2f43a08)
Signed-off-by: Tibor Vass <tibor@docker.com>
2016-07-08 15:31:42 -07:00
John Howard ddae91f21a Windows: Skip RunCidFileCleanupIfEmpty on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 20424fccdd1ba874277eca7d9644b1ef98ac4b2e)
2016-07-01 00:39:50 -07:00
John Howard 9185a0a681 Windows: Skip TestBuildEmptyCmd on RS1
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 45da1274421ba7484dcf2bf1a398f9e3683600d1)
2016-07-01 00:39:50 -07:00
Yong Tang b34706b152 Use HOSTNAME in the output of `docker node ls`
This fix tries to address an issue raised in #24090 where
the title field of `docker node ls` use NAME instead of
HOSTNAME. Yet the content of this field is actually
hostname.

The fix makes needed changes for the output of
`docker node ls`.

An additional test has been added to cover the change in
this fix.

This fix fixes #24090.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 4bc91ceeb750db6a6270b2f1821cb0b2f30117fc)
2016-06-30 17:12:45 -07:00
Tonis Tiigi f492978638 Add test for force-new-cluster
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 1acb8ef82572c52994b1ff00fe5c86aac53be4b8)
2016-06-30 16:57:31 -07:00
Tonis Tiigi 7b70250d07 Switch node management tests to api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 22b34d64496c9b6ebae5e2b4a98ecd9a172cc557)
2016-06-30 16:57:31 -07:00
Wonjun Kim 9ce196dc3c Add integration tests for swarm incompatible
Signed-off-by: Wonjun Kim <wonjun.kim@navercorp.com>
(cherry picked from commit d71789828f5c8d2e0f5757f1c003325c4b8a871d)
2016-06-30 16:57:21 -07:00
Anusha Ragunathan 43186c4304 Fix daemon tests.
Fix two test issues:
- pidof is not available in PATH on some Jenkins systems (rhel, centos)
  Use kill -0 instead.
- Cleanup after plugin test. This is a stop gap fix. The right way to
  fix this, is to shutdown the plugin on daemon shutdown path (except
  for the live-restore case). This will be done in a follow up PR.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 6d36431e2395867d7bb101dbfd4340e132fd5438)
2016-06-30 16:47:53 -07:00
Anusha Ragunathan 8ac21ed2d4 Add plugin restore tests.
Also live restore is stable now. So move experimental tests out to stable.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
(cherry picked from commit 006d58d7e6756848058bd69a12c698c44e64efd1)
2016-06-30 16:47:51 -07:00
Kenfe-Mickael Laventure 7a5e247d01 Use "docker-runc" as alias for the default runtime
This also moves the variable holding the default runtime name from the
engine-api repository into docker repository

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit 69af7d0d13670b8e2a03a38b4d9a849fc109b338)
2016-06-30 16:47:51 -07:00
Tonis Tiigi e5fb8b1fb6 Disable iptables in swarm test daemons
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit caaf92f7b4b947c5d226fb66a355b60fac683979)
2016-06-30 16:47:50 -07:00
Sainath Grandhi eebd6ac4df docker rename fix to address the issue of renaming with the same name issue #23319
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
(cherry picked from commit 3e8c16ef6d5e6b451996722d99f5d646ed8a0e56)
2016-06-30 16:47:48 -07:00
Tonis Tiigi de5fd9d641 Increase test timeouts for node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 2e5da4434126309f2395cc3d5b2013674155ae5c)
2016-06-30 16:47:47 -07:00
Alvaro Saurin c2b195d3c2 Make sure we are trying to unmount a mounted /etc/resolv.conf
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
(cherry picked from commit 41cc7c4d9ddb6d6b9e024f30806adc82f1bb1d4a)
2016-06-30 16:47:47 -07:00
Alvaro Saurin 3e6c39e2ee Make sure we compare strings with the same capitalization
Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
(cherry picked from commit ded347e744e74b99c023b30b53fcabe2c3bde24c)
2016-06-30 16:47:47 -07:00
Tonis Tiigi 3d06cd4910 Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit fb3eb1c27ef5520571c599ead8a72b343748db39)
2016-06-30 16:47:44 -07:00
nick 62d50a3f13 Fix misspell typos
Signed-off-by: nick <nicholasrusso@icloud.com>
(cherry picked from commit 7135afa79b4d99ba2a214fcc1c2decf95f850c2f)
2016-06-30 16:47:43 -07:00
Derek McGowan aa123b73d1 Add tests for rmi
Add integration test for removing by image id with tag and digest reference to the same repository.
Add integration test to ensure only tag to other repository remains after deleting tag with accompanying digest reference.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
(cherry picked from commit 5cff374b140b4a836b7082d009bcfe9a6e96f1af)
2016-06-30 16:47:39 -07:00
Tonis Tiigi 8a994d4724 Don’t try to restore swarm from incomplete state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit ded1d9af38cb467dadab0521936174eef0d4bc9e)
2016-06-30 16:47:37 -07:00
Yong Tang 92ffbd2b52 Fix `docker start` error with renamed container
This fix tries to fix the issue raised in #23716 where `docker start`
causes an error of `No such container:` if the container has been
renamed before `docker start` returns.

The issue is that `docker start` use container name passed at the
beginning to check for exit code at the end of the `docker start`.

This fix addresses the issue by always use container's `ID` to get
the information during `docker start`.

Additional integration tests have been added to cover this fix.

This fix fixes #23716.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
(cherry picked from commit 6e86733b47faf0d7629751987346022544b65cb7)
2016-06-30 16:47:37 -07:00