Commit Graph

61 Commits

Author SHA1 Message Date
fe821da2fd integration: use %s for check.Commentf()
It is wrong to pass an arbitrary string to a function expecting
%-style formatting. One solution would be to replace any % with %%,
but it's easier to just do what this patch does.

Generated with:

for f in $(git grep -l 'check.Commentf(out)'); do \
	sed -i -e 's/check\.Commentf(out)/check.Commentf("%s", out)/g' $f; \
done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 83363fb2d4d97d952a0052d079faa8ae39aa20b6
Component: engine
2018-08-14 10:45:39 +03:00
a174fffcfe Fix ineffassign linting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ddd8a6572d36a6d0db2aa21d697018f419a7b424
Component: engine
2018-07-11 22:18:45 +02:00
e3af8e0774 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>
Upstream-commit: 7d62e40f7e4f3c17d229a7687d6fcca5448de813
Component: engine
2018-04-23 13:52:44 -07:00
84f41cfc7e Merge pull request #36838 from vdemeester/integration-fixtures-refactoring
Clean some integration-cli/fixtures package/files
Upstream-commit: f9c4e630269be438cddfe843c727c21c3343f1c2
Component: engine
2018-04-16 17:49:29 -07:00
c2c6cea1b0 Clean some integration-cli/fixtures package/files
- Move go package used by both `integration-cli` and `integration` to
  `internal/test/fixtures`.
- Remove fixtures that are not used anymore (moved to `docker/cli` a
  while ago) : deploy, notary, secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5f56503f583f21d655394f755f71849381bd58c7
Component: engine
2018-04-16 10:48:58 +02:00
bd6e299583 Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 239a8a518904dfb51fe62087d8702519c20ce808
Component: engine
2018-04-16 10:20:10 +02:00
aac739f262 Migrate DockerTrustSuite to docker/cli e2e tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5433ceb12ead305d8c85e8e27c4b4d842ef88ae0
Component: engine
2018-03-19 09:26:35 +01:00
49adb54d71 Remove duplicate calls for getting an APIClient
Remove request.SockRequest
Remove request.SockRequestHijack
Remove request.SockRequestRaw()
Remove deprecated ParseHost
Deprecate and unexport more helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4
Component: engine
2018-02-20 17:27:24 -05:00
de027de052 Remove deprecated environment.DockerBasePath()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 142b1f8bfb3a1459660a5877b48f2bd7d17ba5d6
Component: engine
2018-01-15 15:29:26 +01:00
b7dabb480c Fix potential panic during plugin set.
Plugin config can have Mounts without a 'Source' field. In such cases,
performing a 'plugin set' on the mount source will panic the daemon. Its
the same case for device paths as well. This detects the case and
returns error.

Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
Upstream-commit: 6572e27df7f3483cfed7a8294c1f6d9cf157809a
Component: engine
2017-11-28 13:06:24 -08:00
e8bff97a66 Update tests to use icmd
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 92427b3a8146e048c4b85e5ece1530da97d8472d
Component: engine
2017-08-25 12:07:30 -04:00
4d6d2b530e Turn off plugin upgrade test when userns on
Until volume plugins can be made aware of the remapped root,
interactions with volumes created by plugin will not work as the file
ownership denies permissions to the userns remapped range.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: b1ced2af03c5a8009c314bde80b5f2516e0522fd
Component: engine
2017-08-24 10:52:11 -07:00
5d957152ba Testing: Use local plugins, not from hub
Use the (new) plugin fixtures for plugin tests rather than pulling
plugins from hub.

This removes the restriction for platforms/archs since plugin binaries
get built in the test environment.

Future work would be to add test plugins for the various subsystems so
tests that are actually using plugins (e.g. volumes, networks) can be
ported to use the fixtures as well.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 15a538a627e1d0898862c9e6ca7472cd7fb517ce
Component: engine
2017-07-14 13:24:14 -04:00
643654c2f0 Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 39bcaee47b8a284a46b761afe218ba7deda0d482
Component: engine
2017-07-03 13:13:09 -07:00
e9abb077b7 Add support for metrics plugins
Allows for a plugin type that can be used to scrape metrics.
This is useful because metrics are not neccessarily at a standard
location... `--metrics-addr` must be set, and must currently be a TCP
socket.
Even if metrics are done via a unix socket, there's no guarentee where
the socket may be located on the system, making bind-mounting such a
socket into a container difficult (and racey, failure-prone on daemon
restart).

Metrics plugins side-step this issue by always listening on a unix
socket and then bind-mounting that into a known path in the plugin
container.

Note there has been similar work in the past (and ultimately punted at
the time) for consistent access to the Docker API from within a
container.

Why not add metrics to the Docker API and just provide a plugin with
access to the Docker API? Certainly this can be useful, but gives a lot
of control/access to a plugin that may only need the metrics. We can
look at supporting API plugins separately for this reason.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0e8e8f0f318656be80e34db9b5e390ffeef3fd0d
Component: engine
2017-05-12 00:30:09 -04:00
987b06e286 Use cli for trusted relate command
This also removed some skipped test (that are skipped for a long while).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b0ba39d4312ff20b11fc777092cc0c3e5ddeb19f
Component: engine
2017-04-19 14:04:39 +02:00
6079289459 Merge pull request #30047 from duglin/distError
Add the mediaType to the error
Upstream-commit: e10f9db26d7db8396d6f70419ecd1aa081190069
Component: engine
2017-03-10 16:44:49 -08:00
528e9e6c7b [multi-arch] skip more plugin tests on non-x86
Until the plugins are multi-arch plugins, or built on runtime,
skip these tests like we do with the remainder of the plugin tests.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 362d082b6e67f2cd40d677b50b10fe76b3695279
Component: engine
2017-02-28 16:53:30 -05:00
e5361f1d31 Add the mediaType to the error
Without this fix the error the client might see is:
	target is unknown
which wasn't helpful to me when I saw this today. With this fix I
now see:
	MediaType is unknown: 'text/html'
which helped me track down the issue to the registry I was talking to.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: c127d9614f5b30bd73861877f8540a63e7d869e9
Component: engine
2017-02-28 11:36:32 -08:00
a14a8b183d Make propagated mount persist outside rootfs
This persists the "propagated mount" for plugins outside the main
rootfs. This enables `docker plugin upgrade` to not remove potentially
important data during upgrade rather than forcing plugin authors to hard
code a host path to persist data to.

Also migrates old plugins that have a propagated mount which is in the
rootfs on daemon startup.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e8307b868de9f19bb97f5cafcd727df5c5f501be
Component: engine
2017-02-03 16:22:58 -05: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
5fa515a0ff Add --format flag for docker plugin ls
This fix tries to address the enhancement discussed in 28735 to add
`--format` for the output of `docker plugin ls`.

This fix
1. Add `--format` and `--quiet` flags to `docker plugin ls`
2. Convert the current implementation to use `formatter`, consistent with
   other docker list commands.
3. Add `pluginsFormat` for config.json.

Related docs has been updated.

Several unit tests have been added to cover the changes.

This fix is related to 28708 and 28735.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 1c0d37fa7f04ade13e65aff74ea0495bb846d782
Component: engine
2017-01-20 15:59:44 -08:00
f7b8e381ec Use testEnv methods and remove most of the global variables
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c8016e669f9507480745a441ba4cd735150ebb85
Component: engine
2017-01-17 12:39:08 +01:00
6a39de5e4f Merge pull request #29947 from vdemeester/integration-some-runCommandWithOutput-clean
[test-integration] clean some runCommandWithOutput
Upstream-commit: e5058ff15cac51836f426175df8a7840a670f046
Component: engine
2017-01-10 15:56:42 +01:00
78d1ff88be Update trustedCmd to be compatible with testutil/cmd
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 303b1d200af65ebb165602d0137f8b24b7c54d66
Component: engine
2017-01-09 11:07:05 +01:00
beeae010cf Set plugins used in tests back to original names
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: f4798b98fc2c8d3d7688fdd7c1a055f452c29770
Component: engine
2017-01-05 13:55:43 -08:00
cee6d6487a Merge pull request #29556 from mavenugo/refcount
Fixing a couple of network plugin life-cycle mgmt issues
Upstream-commit: 2ef6d8045415899b3faf8b68c0c732aa8c18917d
Component: engine
2017-01-03 11:13:22 -08:00
bc659af9d7 Handle Plugin reference count during network create and delete
Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: fc2c0e623d3c7fd7f3d7e9632a765adbcc893108
Component: engine
2016-12-30 12:28:22 -08:00
2758f0996d Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 33968e6c7df164fff0a882c50ae7f4f7e6190e4b
Component: engine
2016-12-30 18:26:34 +01:00
ee3cf2ce35 Tests to allow ID-based docker plugin enable/disable/rm/set
This fix is a follow up based on comment:

and a follow up to:
https://github.com/docker/docker/pull/29222#issuecomment-268908937

As #28789 has been merged in, it is possible for `docker plugin inspect`
to search based on Name or ID Prefix. However, ID-based
`docker plugin enable/disable/rm/set` are still not possible.

This fix addes test for  `docker plugin enable/disable/rm/set` to search based on:
- Full ID
- Full Name
- Partial ID (prefix)

The actual fix is done in  #29487.

This fix is a follow up of #28789 and  #29487.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: c80e74e8cc28e9b6197e68321f2402c30de3e895
Component: engine
2016-12-28 14:10:43 -08:00
17e3d2d6b6 Support for docker content trust for plugins
Add integration test for docker content trust

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 14e8bba4f5d39e7a540bee44c133a1e73db48f84
Component: engine
2016-12-27 12:51:00 -08:00
478844dff8 Implement content addressability for plugins
Move plugins to shared distribution stack with images.

Create immutable plugin config that matches schema2 requirements.

Ensure data being pushed is same as pulled/created.

Store distribution artifacts in a blobstore.

Run init layer setup for every plugin start.

Fix breakouts from unsafe file accesses.

Add support for `docker plugin install --alias`

Uses normalized references for default names to avoid collisions when using default hosts/tags.

Some refactoring of the plugin manager to support the change, like removing the singleton manager and adding manager config struct.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 3d86b0c79b16334ce5836c0315e4c310b84c2e17
Component: engine
2016-12-23 13:29:58 -08:00
e6fc7a5576 Merge pull request #29599 from anusha-ragunathan/refcount
Enforce zero plugin refcount during disable, not remove.
Upstream-commit: d1dfc1a5ef95dc5621a07915f9786199442043c7
Component: engine
2016-12-22 15:38:54 -08:00
9eac558235 Enforce zero plugin refcount during disable.
When plugins have a positive refcount, they were not allowed to be
removed. However, plugins could still be disabled when volumes
referenced it and containers using them were running.

This change fixes that by enforcing plugin refcount during disable.
A "force" disable option is also added to ignore reference refcounting.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 8cb2229cd18c53bdbf36301f26db565a50027d6a
Component: engine
2016-12-22 13:26:53 -08:00
dd179255a2 Fix docker plugin inspect <unkown object> issue on Windows
This fix is a follow up for comment:
https://github.com/docker/docker/pull/29186/files#r91277345

While #29186 addresses the issue of `docker inspect <unknown object>`
on Windows, it actually makes `docker plugin inspect <unknown object>`
out `object not found` on Windows as well. This is actually misleading
as plugin is not supported on Windows.

This fix reverted the change in #29186 while at the same time,
checks `not supported` in `docker inspect <unknown object>` so that
- `docker plugin inspect <unknown object>` returns `not supported` on Windows
- `docker inspect <unknown object>` returns `not found` on Windows

This fix is related to #29186 and #29185.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0b3c10ac4ddfe3655bac080440a8553269f2307f
Component: engine
2016-12-20 21:05:10 -08:00
645f8e7ad5 [integration-cli] skip plugin tests on non-x86
Due to the test plugins being architecture specific, these
tests fail to start the plugin (even though they don't fail yet)

Temporary fix until we can build architecture specific test
plugins.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: ebff8c79a3b834c555f92e673c604f14fa0afa33
Component: engine
2016-12-12 17:17:45 -05:00
656f60dc73 plugins: container-rootfs-relative paths
Legacy plugins expect host-relative paths (such as for Volume.Mount).
However, a containerized plugin cannot respond with a host-relative
path. Therefore, this commit modifies new volume plugins' paths in Mount
and List to prepend the container's rootfs path.

This introduces a new PropagatedMount field in the Plugin Config.
When it is set for volume plugins, RootfsPropagation is set to rshared
and the path specified by PropagatedMount is bind-mounted with rshared
prior to launching the container. This is so that the daemon code can
access the paths returned by the plugin from the host mount namespace.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: c54b717caf1a55e525ce180bfcb42addd59c6633
Component: engine
2016-12-09 10:16:24 -08:00
2ac57c6dcf Allow docker plugin inspect to search based on ID or name
This fix tries to address the issue raised in discussion of
PR 28735 where it was not possible to manage plugin based on
plugin ID. Previously it was not possible to invoke
`docker plugin inspect` with a plugin ID (or ID prefix).

This fix updates the implementation of `docker plugin inspect`
so that it is possbile to search based on a plugin name, or a
plugin ID. A short format of plugin ID (prefix) is also possible,
as long as there is no ambiguity.

Previously the check of `docker plugin inspect` was mostly done
on the client side. This could potentially cause inconsistency
between API and CMD. This fix move all the checks to daemon side
so that API and CMD will be consistent.

An integration test has been added to cover the changes.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 0ce6e070f7d1e4b1b478d52b4464f8480dbfd9b7
Component: engine
2016-12-01 10:44:17 -08:00
c06179cb55 Fix issue caused by duplicate docker plugin create with same names
This fix tries to fix the issue raised in 28684:
1. Duplicate plugin create with the same name will override the old plugin reference
2. In case an error happens in the middle of the plugin creation, plugin directories
   in `/var/lib/docker/plugins` are not cleaned up.

This fix update the plugin store so that `Add()` will return an error if a plugin
with the same name already exist.

This fix also will clean up the directory in `/var/lib/docker/plugins` in case
an error happens in the middle of the plugin creation.

This fix fixes 28684.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 662d456928e47162a3af5931356cb05b6a3f9918
Component: engine
2016-11-28 12:37:49 -08:00
160495ca21 Fixes some integration-cli on userns
Mainly adding requirements on Network or NotUserNamespace to make it pass.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: eb5fe064cfb8475e9f6fb9beac98ad6ce63be2a3
Component: engine
2016-11-23 14:03:53 +01:00
f20a7bc47c plugins: fix some tests
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: a08ffa0e934e5f8b95855cc5bd0cc2a6b3cf4091
Component: engine
2016-11-21 16:34:10 -08:00
e5cb7de38d Skip plugin tests if not in amd64
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e23e36f25cc55fd273fa04f2dd9d3772683ee381
Component: engine
2016-11-11 09:52:13 -08:00
fadae43674 move plugins out of experimental
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: c410222e42fb9195909390337bc129c6481e2453
Component: engine
2016-11-10 15:51:32 -08:00
6949dd3368 rename plugin manifest
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 49ca91fbebbea80587ce3c0814bba3b41cce14a0
Component: engine
2016-11-10 00:09:23 -08:00
5a46073d11 Merge pull request #28086 from vieux/delete_rootfs_plugin
delete plugin rootfs on `docker plugin rm`
Upstream-commit: 4b63ad33ec77dbf15879da8ce8a7870d58f562bd
Component: engine
2016-11-08 17:03:01 -08:00
2153863109 delete plugin rootfs on plugin rm
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 586b7cc19ef289b0f60a859ca75ec6a9eb97120d
Component: engine
2016-11-08 03:30:37 -08:00
a24a48331c support settings in docker plugins install
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 69276fddf8269e6de7bf297d4a7127e0ed977cb7
Component: engine
2016-11-07 22:49:22 -08:00
a773a75547 support env for docker plugin set
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: efbed4500e30ff1a0eef4ff71fd46a58363d041b
Component: engine
2016-11-07 16:59:29 -08:00
c39056bb71 add test plugin install --disable and volume ls
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 7236e42046a8e80ac5e35c46b0910859fcbd814d
Component: engine
2016-11-02 17:03:46 -07:00
eb62ebf173 Add requirements for tests that require network
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: da9ef68f06e9c73b0913a53dbe31fce3244536a2
Component: engine
2016-10-12 11:11:23 -07:00