Commit graph

85 commits

Author SHA1 Message Date
lixiaobing10051267
feadc5171a add break when found in TestVolumeCLICreateWithOpts()
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
2016-12-08 15:59:52 +08:00
Yong Tang
9ce8aac55e Show volume options for docker volume inspect
This fix tries to address the issue raised in 25545 where
volume options at the creation time is not showed up
in `docker volume inspect`.

This fix adds the field `Options` in `Volume` type and
persist the options in volume db so that `volume inspect`
could display the options.

This fix adds a couple of test cases to cover the changes.

This fix fixes 25545.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-20 05:14:27 -07:00
Elena Morozova
64238fef8c all: replace loop with single append
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
2016-10-13 13:31:52 -07:00
Akihiro Suda
7fb7a477d7 [nit] integration-cli: obey Go's naming convention
No substantial code change.

 - Api         --> API
 - Cli         --> CLI
 - Http, Https --> HTTP, HTTPS
 - Id          --> ID
 - Uid,Gid,Pid --> UID,PID,PID
 - Ipam        --> IPAM
 - Tls         --> TLS (TestDaemonNoTlsCliTlsVerifyWithEnv --> TestDaemonTLSVerifyIssue13964)

Didn't touch in this commit:
 - Git: because it is officially "Git": https://git-scm.com/
 - Tar: because it is officially "Tar": https://www.gnu.org/software/tar/
 - Cpu, Nat, Mac, Ipc, Shm: for keeping a consistency with existing production code (not changable, for compatibility)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-09-30 01:21:05 +00:00
Kara Alexandra
ba3f0bf0e7 Add option to specify name without --name in volume create
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-25 14:20:06 -07:00
Daniel Nephin
243885808f Change to use c.Assert() instead of result.Assert()
Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:12:36 -04:00
Daniel Nephin
d7022f2b46 Create a unified RunCommand function with Assert()
Remove some run functions and replace them with the unified run command.
Remove DockerCmdWithStdoutStderr
Remove many duplicate runCommand functions.
Also add dockerCmdWithResult()
Allow Result.Assert() to ignore the error message if an exit status is expected.
Fix race in DockerSuite.TestDockerInspectMultipleNetwork
Fix flaky test DockerSuite.TestRunInteractiveWithRestartPolicy

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Yong Tang
6c5c34d50d Add --force in docker volume rm to fix out-of-band volume driver deletion
This fix tries to address the issue in raised #23367 where an out-of-band
volume driver deletion leaves some data in docker. This prevent the
reuse of deleted volume names (by out-of-band volume driver like flocker).

This fix adds a `--force` field in `docker volume rm` to forcefully purge
the data of the volume that has already been deleted.

Related documentations have been updated.

This fix is tested manually with flocker, as is specified in #23367.
An integration test has also been added for the scenario described.

This fix fixes #23367.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-18 18:01:25 -07:00
Kai Qiang Wu(Kennan)
1a72934cd5 Add label filter support for volume
Since we added labels for volume, it is desired to have
filter support label for volume

Closes: #21416
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-08-11 13:08:04 -04:00
Vincent Demeester
a488ad1a09
Add volume --format flag to ls
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-08-04 14:59:55 +02:00
Daniel Nephin
667dcb0e8e Update usage and help to (almost) match the existing docker behaviour
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-05-31 14:41:37 -07:00
Kai Qiang Wu(Kennan)
8e9305ef94 Add name/driver filter support for volume
This change include filter `name` and `driver`,
and also update related docs to reflect that filters usage.

Closes: #21243

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-03-25 01:11:17 +00:00
Evan Hazlett
fc214b4408 add label support for build, networks and volumes
build: implement --label

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

network: allow adding labels on create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

volume: allow adding labels on create

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

add tests for build, network, volume

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vendor: libnetwork and engine-api bump

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2016-03-22 11:49:06 -04:00
Brian Goff
b05b237075 Support mount opts for local volume driver
Allows users to submit options similar to the `mount` command when
creating a volume with the `local` volume driver.

For example:

```go
$ docker volume create -d local --opt type=nfs --opt device=myNfsServer:/data --opt o=noatime,nosuid
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-03 10:32:25 -05:00
Kai Qiang Wu(Kennan)
60ffd6c880 Make volume ls output order
Fixes: #20384
Add order support for volume ls to make it easy
to external users to consume.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-02-17 09:01:27 +00:00
Vincent Demeester
382c96ee7b Add a getPrefixAndSlashFromDaemonPlatform …
… to limit code duplication in integration tests :P

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-02-03 15:16:00 +01:00
David Calavera
1431b623a4 Make volume dangling filter return only used volumes with dangling=false.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-25 16:26:51 -05:00
Kai Qiang Wu(Kennan)
66c253cbf7 Fix volume filter validation
Fixes: #18890
This fix add same filter validation logic as images. We should
add such check to make sure filters work make sense to end-users

Right now, we keep old use 1 as filter, but in long term, it should
be have same interface checking as images, it could be improved in
other patches.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-01-18 10:07:42 +00:00
Brian Goff
d3eca4451d 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>
2016-01-05 16:28:38 -05:00
Justas Brazauskas
927b334ebf Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
2015-12-13 18:04:12 +02:00
David Calavera
57b6796304 Implement all inspect commands with the new inspector interface.
It makes the behavior completely consistent across commands.
It adds tests to check that execution stops when an element is not
found.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-09 12:05:01 -05:00
Vincent Demeester
d125ddaeda Fix DockerSuite.TestVolumeCliInspectMulti
Use dockerCmdWithError now that it actually returns an error code.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-12-07 08:34:18 +01:00
Sebastiaan van Stijn
5b4734aaa5 Merge pull request #17788 from haoshuwei/modify-volume-inspect-multi
Modify docker volume inspect to return existed volumes and the names of the unexsited volumes
2015-12-06 14:03:46 +01:00
David Calavera
b9d30280f6 Return error code when volume inspect fails with a template.
Following `docker inspect` conventions:

- Keep partial info in a buffer to not print incomplete template outputs.
- Break execution when template parsing or decoding fail.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-03 13:22:55 -05:00
Shuwei Hao
6295345005 Modify docker volume inspect to return existed volumes
Signed-off-by: Shuwei Hao <haoshuwei24@gmail.com>
2015-12-01 01:43:02 +00:00
Bryan Boreham
899caaca9c Fix spelling of 'existent'
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2015-11-25 13:45:37 +00:00
John Howard
8209571982 Windows: Remove check for volume support
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-11-13 13:02:30 -08:00
John Howard
2af5034ce8 Windows: Volume integration tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-26 14:33:28 -07:00
Kun Zhang
0ff3123eba volume create error on conflict option
Signed-off-by: Kun Zhang <zkazure@gmail.com>
2015-10-12 11:16:39 +08:00
Brian Goff
2feebd95d3 Make docker volume behave like docker network
Before, typing `docker volume` with no args would forward to the handler
for `docker volume ls`, except the flags for the `ls` subcommand were
not supported.
Instead just print the cmd usage.

This makes the behavior of the `docker volume` subcommand behave exactly
like the `docker network` subcommand.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-07 13:36:46 -04:00
Vincent Demeester
5109071706 Add unit tests for integration cli utils function
- utils_test.go and docker_utils_test.go
- Moved docker related function to docker_utils.go
- add a test for integration-cli/checker

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-09-09 15:36:44 +02:00
Sebastiaan van Stijn
1cbf9047b3 Fix docker volume dangling filter
The docker volume ls -f dangling=true filter was
inverted; the filtered results actually returned all
non-dangling volumes.

This fixes the filter and adds some integration tests
to test the correct behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-09-06 20:17:56 +02:00
John Howard
f9a3558a9d Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-04 12:32:40 -07:00
Brian Goff
38da43184d Fix docker volume invalid so it displays usage
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-27 09:46:05 -04:00
Brian Goff
b3b7eb2723 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-26 13:37:52 -04:00