Commit Graph

56 Commits

Author SHA1 Message Date
5b28f437b0 Fix issue with multiple volume refs with same name
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0fe31306d1c1c93c4ef33654f7a37932296cf8a6
Component: engine
2016-02-16 21:46:13 -05:00
98ffe8be11 Merge pull request #20198 from cpuguy83/check_drivers_b4_vol_create
Check drivers before vol create
Upstream-commit: 79edcc517231e46d1fa9e03081488527143eefae
Component: engine
2016-02-12 18:41:48 -05:00
697a990701 fix common misspell
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 99a396902f0ea9d81ef87a683489b2435408f415
Component: engine
2016-02-11 15:49:36 -08:00
91c83926d7 Remove back-compat hacks from for volume plugins.
Hacks were added as interim support for 1.10 but should not be needed
for 1.11.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 3403a01b07a73defe9f15c30e16ec8dfcab50439
Component: engine
2016-02-10 20:43:20 -05:00
13ec79c31c Probe all drivers if volume driver not specified
This fixes an issue where `docker run -v foo:/bar --volume-driver
<remote driver>` -> daemon restart -> `docker run -v foo:/bar` would
make a `local` volume after the restart instead of using the existing
volume from the remote driver.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 00ec6102d993a752bd8dfb4ee393a4e58e59a4fe
Component: engine
2016-02-10 20:43:15 -05:00
4075818bf4 Fix volume driver API compatibility mode (a little)
Signed-off-by: Stephen Rust <srust@blockbridge.com>
Upstream-commit: c3985bdf797a4526eac5fb0bd92047ac0f8513d9
Component: engine
2016-02-08 23:12:29 -05:00
debd24d25b fix dead lock in volume store dereference
Signed-off-by: Pei Su <sillyousu@gmail.com>
Upstream-commit: f5310652d30e72fe88a3edc70b2911397c28b7e4
Component: engine
2016-01-27 16:34:10 +08:00
92c9319930 Merge pull request #19671 from calavera/volume-dangling
Make volume dangling filter return only used volumes with `dangling=false`.
Upstream-commit: 146e49b039c59107cc31de734f0bf5d4604c04d9
Component: engine
2016-01-26 17:01:20 -05:00
360e6f6c70 Merge pull request #19568 from cpuguy83/17907_fix_rmv
On container rm, don't remove named mountpoints
Upstream-commit: 58c2488d07f4c984c853ca4b4a5c86b55c4c784c
Component: engine
2016-01-25 18:13:57 -08:00
9d1352af0d Make volume dangling filter return only used volumes with dangling=false.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 1431b623a4809ec3992a357387037366ab083548
Component: engine
2016-01-25 16:26:51 -05:00
7e07ac8939 On container rm, don't remove named mountpoints
This makes it so when calling `docker run --rm`, or `docker rm -v`, only
volumes specified without a name, e.g. `docker run -v /foo` instead of
`docker run -v awesome:/foo` are removed.

Note that all volumes are named, some are named by the user, some get a
generated name. This is specifically about how the volume was specified
on `run`, assuming that if the user specified it with a name they expect
it to persist after the container is cleaned up.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: dd7d1c8a02d8693aa4f381f82c5bbdcad9a5ff58
Component: engine
2016-01-25 15:51:28 -05:00
f0e82098a7 Add back compat for volume drivers Get and Ls
Use a back-compat struct to handle listing volumes for volumes we know
about (because, presumably, they are being used by a container) for
volume drivers which don't yet support `List`.

Adds a fall-back for the volume driver `Get` call, which will use
`Create` when the driver returns a `404` for `Get`. The old behavior was
to always use `Create` to get a volume reference.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f6c20d9b22ec9913f67b6c2ebdb5ef07c87b8cd7
Component: engine
2016-01-22 22:48:17 -05:00
edde0f73ca Use fine-grained locks for plugin loading.
This helps ensure that only one thing is trying to intialize a plugin at
once while also keeping the global lock free during initialization.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: cfb2c667ad0bb17d9a1bd49a294d5c38e4cbf040
Component: engine
2016-01-20 13:57:52 -05:00
7d383f2b5f On create, copy image data for named volumes.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b4683327074d193428c724b153e8848ef2068c1d
Component: engine
2016-01-07 21:57:08 -05:00
db1910a30c Move responsibility of ls/inspect to volume driver
Makes `docker volume ls` and `docker volume inspect` ask the volume
drivers rather than only using what is cached locally.

Previously in order to use a volume from an external driver, one would
either have to use `docker volume create` or have a container that is
already using that volume for it to be visible to the other volume
API's.

For keeping uniqueness of volume names in the daemon, names are bound to
a driver on a first come first serve basis. If two drivers have a volume
with the same name, the first one is chosen, and a warning is logged
about the second one.

Adds 2 new methods to the plugin API, `List` and `Get`.
If a plugin does not implement these endpoints, a user will not be able
to find the specified volumes as well requests go through the drivers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d3eca4451d264aac564594fe46b8c097bd85a5cc
Component: engine
2016-01-05 16:28:38 -05:00
26657d68aa update volume name regex
Disallow creating a volume starting with a /.

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: b46f044bf71309088b30c1172d4c69287c6a99df
Component: engine
2016-01-04 15:00:49 -08:00
7bea2a5a61 Move volume.SplitN() to the one place it is used in runconfig.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c5a2fdb697e403af228a68d08c68d17d347f6cf3
Component: engine
2016-01-04 12:06:30 -05:00
3f495d0416 Fix downstream client API build errors on Solaris
The client API at fsouza/go-dockerclient has dependencies on packages in
the docker/docker repository which currently do not build on Solaris. In
particular, stat_unsupported.go makes use of the Mtimespec field of the
syscall.Stat_t struct, which is not present on Solaris, and a number of
Unix-specific packages do not list Solaris in their compile targets.

This commit adds enough support to be able to build
fsouza/go-dockerclient on SmartOS using Go 1.5.1 without affecting other
platforms.

Signed-off-by: James Nugent <james@jen20.com>
Upstream-commit: c12dbb8c82457a58e209302bf9752aec64234404
Component: engine
2015-12-30 18:25:42 -05:00
51b37769f0 Remove usage of pkg sockets and tlsconfig.
- Use the ones provided by docker/go-connections, they are a drop in replacement.
- Remove pkg/sockets from docker.
- Keep pkg/tlsconfig because libnetwork still needs it and there is a
  circular dependency issue.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 8e034802b7ad92a29f08785e553415adcd1348a3
Component: engine
2015-12-29 19:27:12 -05:00
c127109fa3 volume: store: store.go: remove debug message
When driver is `local` an empty string is given to the debug message.
This patch removes the debug statement.

```
Dec 20 19:07:01 localhost.localdomain docker[19734]:
time="2015-12-20T19:07:01.872021857+01:00" level=debug msg="Registering
new volume reference: driver , name
c2291b964b4d7b1b51ec51d2ccfe2544f83fd23404709225a43743c5faadad55"
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 23a18b5f93b4dfbed419509589687220e5aff487
Component: engine
2015-12-21 19:14:27 +01:00
2a2006ef18 Merge pull request #17034 from rhvgoyal/volume-propagation
Capability to specify per volume mount propagation mode
Upstream-commit: ce0b1841c82b6972d96654e083f813944e72443f
Component: engine
2015-12-15 12:14:41 -05:00
a1551674ac Add some unit and integration tests
Add a unit test and couple of integration tests for volume propagation.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f988c98ff318dcfecb9d2db9511fe78e70b43e44
Component: engine
2015-12-14 10:39:53 -05:00
c0860c6bed Add capability to specify mount propagation per volume
Allow passing mount propagation option shared, slave, or private as volume
property.

For example.
docker run -ti -v /root/mnt-source:/root/mnt-dest:slave fedora bash

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: a2dc4f79f260247afe55ab7117c9de02a769d883
Component: engine
2015-12-14 10:39:53 -05:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
89ca8a3104 Fix spelling of 'existent'
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Upstream-commit: 899caaca9c990067d541231c6d288de89dbb79e7
Component: engine
2015-11-25 13:45:37 +00:00
b104ad8df6 Remove the container initializers per platform.
By removing deprecated volume structures, now that windows mount volumes we don't need a initializer per platform.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 060f4ae6179b10aeafa883670826159fdae8204a
Component: engine
2015-11-18 08:41:46 -05:00
3e26fccb77 Supported added for reterving Plugin list for Network and Volume.
Also, plugin information in docker info output.

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
Upstream-commit: aa7fd884e609d3d13df628600a1799e0e76444e9
Component: engine
2015-11-16 15:28:09 +09:00
82dda06a38 Windows: Pass store test-unit
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 32b905d90ff133c92bb0dd89207a68c45fc81bbd
Component: engine
2015-11-13 12:39:43 -08:00
cb403bcf07 Refactor volume store's error usage
Uses an errors API similar the `net` package.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 43012fe8425650930a21703d9468ab0e777e053a
Component: engine
2015-11-10 20:33:29 -05:00
aaf8bba9c2 Merge pull request #17185 from cpuguy83/use_finer_locking_for_volume_store
Fix potential races in the volume store
Upstream-commit: cc207aa136fd5e01164d245de94fb900ca7212a2
Component: engine
2015-11-06 08:48:12 -08:00
365046209e Fix potential races in the volume store
Uses finer grained locking so that each volume name gets its own lock
rather than only being protected by the global lock, which itself needs
to be unlocked during cetain operations (`create` especially`)

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: fe66fdd18c0307cc02e6aeff8625c179452b8436
Component: engine
2015-11-04 16:59:47 -05:00
dd17d17d3e Fix volume error messages
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5f4cb33a5186c7822dc718ba915f59979c598c28
Component: engine
2015-10-28 09:23:43 -07:00
f7f7ce4926 Windows: Add volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: a7e686a779523100a092acb2683b849126953931
Component: engine
2015-10-22 10:42:53 -07:00
f1b2a78ca3 Move volume name validation to the local driver.
Delegate validation tasks to the volume drivers. It's up to them
to decide whether a name is valid or not.
Restrict volume names for the local driver to prevent creating
mount points outside docker's volumes directory.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: d6d60287ee3a8a064340582d65c131181ae77127
Component: engine
2015-10-21 12:28:26 -04:00
93c2a19d83 Add user namespace (mapping) support to the Docker engine
Adds support for the daemon to handle user namespace maps as a
per-daemon setting.

Support for handling uid/gid mapping is added to the builder,
archive/unarchive packages and functions, all graphdrivers (except
Windows), and the test suite is updated to handle user namespace daemon
rootgraph changes.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 442b45628ee12ebd8e8bd08497896d5fa8eec4bd
Component: engine
2015-10-09 17:47:37 -04:00
f079e61160 Merge pull request #16493 from cpuguy83/doc_plugin_rpcgen
Add README for pluginrpc-gen
Upstream-commit: 8f7f0f8deb95804eef95b572c53721ea1d0199d9
Component: engine
2015-09-23 15:36:05 -04:00
b761cfeb67 Add README for pluginrpc-gen
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 7acd3ca79d2b13500ca3f53a567cb87fddd4a543
Component: engine
2015-09-22 19:34:44 -04:00
5a458f78ee Move volume ref counting store to a package.
- Add unit tests to make sure the functionality is correct.
- Add FilterByDriver to allow filtering volumes by driver, for future
  `volume ls` filtering and whatnot.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 72bb56618b522fc3cece7cfd706c56296824673d
Component: engine
2015-09-21 12:46:49 -04:00
9f76426e0b Windows: Enabled docker volume
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 42a46ed1a4cd1a6116b3bc5018c29c80db93f928
Component: engine
2015-09-16 14:33:13 -07:00
8ad4ad2e7a Unexport VolumeDriver.
This is not a public interface and users are trying to use it.
We only use it to be able to generate the rpc protocol to talk with a plugin.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 69dde5c0759a9ce686d9b10eb160e6d561322409
Component: engine
2015-09-11 18:19:38 -04:00
52da61961a Ignore stat errors on volume rm.
Underlying volume data may have been removed by some other tool.
Ignore and remove the reference in this case.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8d27417bfeff316346d00c07a456b0e1b056e788
Component: engine
2015-09-08 22:01:02 -04:00
bfe1bbc7d2 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b3b7eb2723461b1eb4be692f4bced0ae8ea9cb58
Component: engine
2015-08-26 13:37:52 -04:00
a8c00ae391 Change return value for ValidateMountMode
1. rename it from ValidateMountMode to ValidMountMode
Because it's a function simply check mount mode is valid or not.
2. remove the rw check return value
It's not supposed to be combined into this function, and we already
have a function for that check.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: c99ed5ae5d0a9167ead73a798b02600ad40651f2
Component: engine
2015-08-24 17:28:19 +08:00
3ee024f425 Don't globally lock on driver initialization
This patch makes it such that plugin initialization is synchronized
based on the plugin name and not globally

Signed-off-by: Darren Shepherd <darren@rancher.com>
Upstream-commit: 164208fde5f1d4bcc4d75333e3309b678edac985
Component: engine
2015-08-18 22:25:30 -07:00
cdd8f67046 lint fixes for volume/*
- comments on exported values
 - constant string replaced by constant reference
 - unexport implementation details of VolumeDriver 'local'
 - add fixed packages to linter list

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 9af963aba032d65bb37eafbbe7cafedfc234edf6
Component: engine
2015-07-28 10:40:44 -07:00
9ec8332d92 Fix read-write check for volumes.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 82a54001fdbd3d0c9bcdab1b5caf0a6c6c8079be
Component: engine
2015-07-14 15:50:43 -07:00
22ed49846c Add test coverage to opts and refactor
- Refactor opts.ValidatePath and add an opts.ValidateDevice
  ValidePath will now accept : containerPath:mode, hostPath:containerPath:mode
  and hostPath:containerPath.
  ValidateDevice will have the same behavior as current.

- Refactor opts.ValidateEnv, opts.ParseEnvFile
  Environment variables will now be validated with the following
  definition :
  > Environment variables set by the user must have a name consisting
  > solely of alphabetics, numerics, and underscores - the first of
  > which must not be numeric.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: dfc6c04fa3f7dcb0e78e9dd5e8e4dd285b98546d
Component: engine
2015-07-12 10:33:30 +02:00
33df474b64 Merge pull request #13835 from cpuguy83/gen-prc
generate plugin clients via template
Upstream-commit: 806b3fa14529a97dfad8fad8ed2a21b26de94492
Component: engine
2015-07-07 17:17:39 -07:00
7b3bea6e05 Plugins JSON spec.
Allow full configuration of external plugins via a JSON document.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 333ac3a3eb09c29c42fe2cea1680621700b67b2f
Component: engine
2015-06-29 10:32:18 -07:00
8ebaf0bd05 use go-generate to build volume/driver/proxy.go
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 88e4dff9a966485413d4acc1ecd99de6a6574e10
Component: engine
2015-06-10 11:42:15 -04:00