Commit Graph

325 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 9c7b0d74cd
Unexport subcommands
These commands were only used as subcommands, so did
not have to be exported.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-18 15:26:45 +02:00
Sebastiaan van Stijn 73163ee78b
Small refactor in system prune
Adapt "image prune" and "build cache prune" to have
the same signature as the other prune commands, so
that they can all be added to the "pruneFuncs" array.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-18 15:13:11 +02:00
Sebastiaan van Stijn 79e4d635ca Merge pull request #315 from ripcurld0/nat_sort
Sort swarm stacks and nodes using natural sorting
2017-07-18 15:01:11 +02:00
Kenfe-Mickaël Laventure 19efbc85f4 Merge pull request #345 from vdemeester/remove-prune-package
Remove useless prune package 👼
2017-07-18 14:46:53 +02:00
Vincent Demeester 3f4d91508e
Remove useless prune package 👼
The `cli/command/prune` just does some aliasing of `Prune*` methods,
doesn't have any use.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-07-18 09:49:02 +02:00
Sebastiaan van Stijn 6c3a448ecb
Fix: skip build-cache prune on unsupported versions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-17 11:55:35 +02:00
Boaz Shuster 1333b49194 Sort swarm stacks and nodes using natural sorting
This commit changes the order stacks and nodes are displayed.
For example, running "docker stack ls" is expected to
display the following list:

NAME          SERVICES
service-1     1
service-2     1
service-10    1

However, currently this is what is printed:

NAME          SERVICES
service-1     1
service-10    1
service-2     1

To fix this, "docker stack ls" and "docker node ls" are using
natural sorting to make it more human readable.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-07-13 14:33:02 +03:00
Sebastiaan van Stijn ae38f202bb Merge pull request #271 from tych0/password-stdin
Password stdin
2017-07-12 17:08:11 -07:00
Ying Li 4615c92f66 Fix warning in docker CLI when `swarm ca --ca-cert`, etc. flags are passed,
and add a test.

Signed-off-by: Ying Li <ying.li@docker.com>
2017-07-12 14:56:28 -07:00
Daniel Nephin f27934376d Fix test and lint failures
Split test cases.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-12 11:37:35 -04:00
Vincent Demeester 87345ed117 Merge pull request #277 from thaJeztah/dont-remove-what-isnt-there
Don't attempt to remove unsupported resources on older daemon
2017-07-12 10:43:54 +02:00
Vincent Demeester fa7687a362 Merge pull request #299 from dnephin/less-verbose-fake-cli
Less verbose fake cli
2017-07-12 09:56:43 +02:00
Daniel Nephin 42a3800783 Update some tests to remove unnecessary buffers.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-11 17:52:43 -04:00
Daniel Nephin 3da0cbfdd1 Remove unnecessary use of SetConfigfile
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-11 14:49:30 -04:00
Daniel Nephin 69b142b52a Update FakeCli to remove duplication in tests.
Use byte buffers by default, since that is what is done most of the time.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-11 14:49:30 -04:00
Daniel Nephin 102a8f0c9d Pin all tools used in the Dockerfiles
Also update gometalinter to use the official version. The update
found some new gosimple errors, which are fixed.

Also update the filewatcher script for the latest version of filewatcher.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-11 14:23:27 -04:00
Tycho Andersen 7d18477bc2 login: add a --password-stdin argument
This:

* conflicts with --password (naturally)
* conflicts with the absence of --username (both can't be grabbed by the
  stdin)
* strips a trailing newline off the password if it exists

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2017-07-11 12:16:29 -06:00
Sebastiaan van Stijn 2429f15672
Don't attempt to remove unsupported resources on older daemon
When running `docker stack rm <some stack>` against an older daemon,
a warning was printed for "configs" being ignored;

    WARNING: ignoring "configs" (requires API version 1.30, but the Docker daemon API version is 1.26)

Given that an old daemon cannot _have_ configs, there should not be
a need to warn, or _attempt_ to remove these resources.

This patch removes the warning, and skips fetching (and removing)
configs.

A check if _secrets_ are supported by the daemon is also added,
given that this would result in an error when attempted against
an older (pre 1.13) daemon.

There is one situation where this could lead to secrets or
configs being left behind; if the client is connecting to a
daemon that _does_ support secrets, configs, but the API version
is overridden using `DOCKER_API_VERSION`, no warning is printed,
and secrets and configs are not attempted to be removed.

Given that `DOCKER_API_VERSION` is regarded a feature for
debugging / "power users", it should be ok to ignore this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-11 10:29:03 -07:00
Sebastiaan van Stijn d8a2972cb1 Remove unused prune functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-10 13:27:19 -07:00
Vincent Demeester af6c0896f5 Merge pull request #298 from dnephin/fix-stack-out-stream
Fix stack output stream
2017-07-10 09:23:23 +02:00
Sebastiaan van Stijn 7ae9bc141c Merge pull request #259 from aaronlehmann/service-progress-surface-error
progress: Show task error in place of progress bar
2017-07-09 00:04:38 -07:00
Sebastiaan van Stijn c99530b1d2 Merge pull request #270 from tych0/warn-only-about-password-on-cli
login: print a big warning when using --password
2017-07-08 16:37:40 -07:00
Aaron Lehmann c9b92a328d progress: Light refactor
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-07-06 10:40:35 -07:00
Yassine TIJANI 45b0e7cf1a fixing SIGSEGV when running containers
Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>

moving the deffering of the close after the error checking

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>

fixing SIGSEGV when running containers

Signed-off-by: Yassine TIJANI <yasstij11@gmail.com>
2017-07-06 18:57:36 +02:00
Vincent Demeester 1aa82bc7df Merge pull request #211 from ksouf/issue-37-add-tests-on-commands
adding network_create tests
2017-07-06 08:59:15 +02:00
Aaron Lehmann e672589ec0 Merge pull request #296 from thaJeztah/fix-error-overwrite
Fix error variable being overwritten
2017-07-05 19:26:27 -07:00
khaled souf 57c1551991 adding unit tests to network
Signed-off-by: khaled souf <khaled.souf@gmail.com>
2017-07-06 00:54:30 +02:00
Sebastiaan van Stijn 4d4c789cac
Fix error variable being overwritten
The `err` variable was set in a loop, so only
the last result was taken into account to return
"failure" or not.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-05 13:54:57 -07:00
Daniel Nephin 0030bfea9f Remove duplication in task formatting.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-05 13:40:47 -04:00
Daniel Nephin fb6deb1077 Fix stream for 'nothing found in stack' message
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-07-05 13:32:54 -04:00
Sebastiaan van Stijn e8080dd7e5
update tests for new image struct
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-04 20:34:24 -07:00
Daniel Nephin 3554d02f33 Merge pull request #276 from adshmh/add-unit-tests-to-checkpoint-package
add unit tests to checkpoint package
2017-07-04 11:17:25 -04:00
Victor Vieux 43fb4a4547 Merge pull request #243 from vieux/scale2
add `--detach` to docker scale
2017-07-04 16:36:59 +02:00
Vincent Demeester 85b41c3e71 Merge pull request #213 from dnephin/improve-swarm-ca-cmd
Refactor and UI changes to `swarm ca` command
2017-07-03 17:02:45 +02:00
Tycho Andersen c269ad26e8 login: print a big warning when using --password
Task command lines are world readable via /proc/pid/cmdline, so this isn't
safe.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2017-07-03 08:47:20 -06:00
Victor Vieux 58d3fc24b1 scale all services at once
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-07-03 13:40:54 +02:00
Arash Deshmeh b296abd542 add unit tests to cli/command/checkpoint package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-30 17:17:47 -04:00
Daniel Nephin 379b762495 Merge pull request #273 from adshmh/add-unit-tests-to-task-package
add unit tests to task package
2017-06-30 11:41:24 -04:00
Arash Deshmeh 244e28f41f add unit tests to task package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-29 17:57:31 -04:00
Daniel Nephin 81e9837859 Refactor caCommand
Split out a swarmCAOptions struct for options that are shared between
the ca and update commands.

Change the 'no trust root' message to an error.

Add some unit tests.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-29 17:57:06 -04:00
Daniel Nephin a04aa8fe28 Compress after rewriting the archive.
Write a test showing compress failure.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-29 13:18:10 -04:00
Vincent Demeester 74af31be7f Merge pull request #227 from dnephin/expose-config
expose config credentials without needing the Cli
2017-06-29 19:11:37 +02:00
Kenfe-Mickaël Laventure 64486d7820 Merge pull request #255 from albers/system-prune-volume-warning
system prune: only warn for volumes if --volumes is given
2017-06-29 08:50:16 -07:00
Harald Albers 849b0e96a0 system prune: only warn about volumes if --volumes is given
Signed-off-by: Harald Albers <github@albersweb.de>
2017-06-29 15:07:21 +02:00
Aaron Lehmann dd3eae84e1 progress: Add unit tests
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-28 17:53:56 -07:00
Charlie Drage d3f9a6c610 on_failure -> on-failure in compose code
on_failure should be on-failure

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2017-06-28 11:10:02 -04:00
Aaron Lehmann 1ef585f65d progress: Show task error in place of progress bar
If a task encounters an error, the interactive "service create" and
"service update" commands should show that error instead of showing a
stuck progress bar.

To validate:

docker service create --detach=false --name broken --restart-condition=none --replicas 3 busybox asdf
and
docker service create --detach=false --name broken --mode global --restart-condition none busybox asdf

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-27 15:12:31 -07:00
Aaron Lehmann 82e069026b progress: Show success message when finished counting down
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-27 15:07:10 -07:00
Victor Vieux 6c6b1091d9 add --detach to docker scale
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-06-27 09:55:10 -07:00
Vincent Demeester 105b21d1ab
Rename NewConfigFile to New in configfile package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-27 16:31:38 +02:00
Daniel Nephin 62dfbef4d8
Add missing unit tests.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-27 13:46:47 +02:00
Daniel Nephin a3cbc70147
Move credential getting functions to the ConfigFile.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-27 13:46:47 +02:00
Daniel Nephin 33cbb70270
Cleanup config/credentials, remove dependency on config file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-27 13:45:50 +02:00
Daniel Nephin a8c70e43a3
Move config file loading to more appropriate packages.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-27 13:45:50 +02:00
Sebastiaan van Stijn cfff0e2259 Merge pull request #207 from cyli/warn-swarm-ca-command
If `docker swarm ca` is not called with the `--rotate` flag, warn if other flags are passed
2017-06-26 20:56:54 -07:00
Victor Vieux db60f25561 hide --detach for docker < 17.05
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-06-26 18:55:30 -07:00
Victor Vieux 0133e13353 Merge pull request #231 from tonistiigi/client-session-fssession
Incrementally sending build context
2017-06-26 17:15:34 -07:00
Sebastiaan van Stijn 2f58992f85 Merge pull request #237 from aaronlehmann/progress-before-assignment
progress: Show progress of replicated tasks before they are assigned
2017-06-26 17:14:07 -07:00
Tonis Tiigi b95638a5ac Use long running session in builder
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>

Add incremental context send support

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-06-26 16:30:01 -07:00
Sebastiaan van Stijn 298d486d8b Merge pull request #235 from vdemeester/234-fix-warn
Add a line break after warning 👼
2017-06-24 02:17:26 -07:00
Aaron Lehmann d3d09f67b1 progress: Show progress of replicated tasks before they are assigned
This was only showing tasks that belong to nodes that are currently up,
so that tasks on down nodes don't appear to be stuck. But this
unintentionally excludes tasks that haven't been assigned yet, so if a
task is stuck before assignment, for example because no nodes meet its
constraints, a progress bar won't even be shown. The check should only
apply to tasks that have a node assignment.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-06-23 17:34:59 -07:00
Tonis Tiigi ae8d049f9e fix build issue with updated moby
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-06-23 16:12:20 -07:00
Daniel Nephin 8b6196ded7 Merge pull request #236 from vdemeester/import-displayable-ports-from-moby
Import DisplayablePorts from moby/moby source
2017-06-23 15:01:53 -04:00
Daniel Nephin c60d13e539 Fix cyclomatic complexity of two formatters
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-23 11:34:22 -07:00
Vincent Demeester b7fad8f1dc
Add a line break after warning 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-23 20:15:00 +02:00
Vincent Demeester 9e142cadc9
Import DisplayablePorts from moby/moby source
This has nothing to do in the `api` package for moby as it's just a
cli display function.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-23 20:12:30 +02:00
Vincent Demeester 0c6b8d717d Merge pull request #221 from dnephin/fix-lint-errors
Fix lint errors merged while new lint branch was in PR
2017-06-23 09:54:12 +02:00
Sebastiaan van Stijn aefbc9d8f7 Merge pull request #202 from ripcurld0/fix_32235_moby
Unmarshal a number as a Number in RawInspectFallback
2017-06-22 23:12:50 -07:00
Daniel Nephin 732261f774 Use compose volume spec parser for container volume flag
Restore testcases for Volume spec parsing.
And correctly interpret the parsed volume.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-21 11:16:04 -04:00
Daniel Nephin db6ff357a7 Some improvements to compose volume spec parsing
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-21 11:13:52 -04:00
Boaz Shuster 9a2f2d769d Unmarshal a number as a Number in RawInspectFallback
Running `docker inspect --format "{{.ID}} {{.Size}}" alpine` prints
sha256:651aa95985aa4a17a38ffcf71f598ec461924ca96865facc2c5782ef2d2be07f 3983636
While `docker inspect --format "{{.Id}} {{.Size}}" alpine` prints
sha256:651aa95985aa4a17a38ffcf71f598ec461924ca96865facc2c5782ef2d2be07f 3.983636e+06

This happens because "Id" is not a field of types.ImageInspect and thus
tryRawInspectFallback is called and converts the raw response into `interface{}`
using a JSON decoder. However, by default that decoder converts numbers into
`float64` unless `UseNumber` is set.

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-06-21 13:10:14 +03:00
Vincent Demeester d5d0ec56c1 Merge pull request #214 from adshmh/add-unit-tests-to-stack-package
add unit tests to stack package
2017-06-21 10:00:08 +02:00
Daniel Nephin b84e21cd05 Fix lint errors merged while new lint branch was in PR.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-21 00:11:59 -04:00
Ying Li 32b43bc21a If `docker swarm ca` is not called with the `--rotate` flag, the other
flags, including cert expiry, will be ignored, so warn if a user attempts
to use `docker swarm ca --cert-expiry` or something.

Signed-off-by: Ying Li <ying.li@docker.com>
2017-06-20 18:55:10 -07:00
Brian Goff 2bfac7fcda Merge pull request #176 from dnephin/new-lint
New linters
2017-06-20 16:47:45 -07:00
Brian Goff 760f847bc8 Merge pull request #195 from Zebrilee/fix-issue-114
fix the issue `--help` doesn't work if daemon is not available
2017-06-20 16:38:36 -07:00
Arash Deshmeh 535af2d868 add unit tests to stack package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-20 14:31:00 -04:00
Dave Tucker 35f1e301b5 Allow Proxy Configuration in config.json
This commit modifies config.json to allow for any proxies allowed in
build-args to be configured. These values will then be used
by default as build-args in docker build.

Signed-off-by: Dave Tucker <dt@docker.com>
2017-06-20 09:51:41 +01:00
zebrilee cca30cb1d9 comment the return of setHelpFunc in order to show --help even if the daemon is not running. Then add a if statement in isSupported function to check if the daemon is running
Signed-off-by: zebrilee <zebrilee@gmail.com>

revert change on docker.go, set HasExperimental to true in cli.go

Signed-off-by: zebrilee <zebrilee@gmail.com>
2017-06-16 10:24:26 +02:00
Arash Deshmeh 7f71d0d979 removed logging from command/formatter package tests
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-15 14:14:59 -04:00
Daniel Nephin 3724fb7f37 Add gosimple lint
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:55:08 -07:00
Daniel Nephin 3e3934c19f Add unparam linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:55:08 -07:00
Daniel Nephin 3bf0317fea Add unconvert linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:54:27 -07:00
Daniel Nephin a712993e93 Add misspell lint
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:54:27 -07:00
Daniel Nephin 01e1e58ada Add unused linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-14 16:54:27 -07:00
Daniel Nephin 759e59e4a4 Merge pull request #182 from vdemeester/180-fix-stack-rm-config-endpoint
Do not call the config endpoint if API is lower than 1.30
2017-06-14 14:31:01 -04:00
Arash Deshmeh 751278abe6 removed logging from service/inspect test to clean up the output of running tests
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-14 12:38:31 -04:00
Vincent Demeester d209929aab Merge pull request #187 from dnephin/small-cleanup-to-image-remove
Fix some problems with image force remove
2017-06-14 09:59:32 +02:00
Vincent Demeester 4ffefe4a1f Merge pull request #115 from jsoref/spelling
Spelling
2017-06-14 09:58:55 +02:00
Vincent Demeester 2128b3f112
Do not call the config endpoint if API is lower than 1.30
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-14 09:56:53 +02:00
Aaron Lehmann 275c488734 Merge pull request #72 from thaJeztah/fix-prefix-matching
Fix prefix-matching for service ps
2017-06-13 14:59:37 -07:00
Aaron Lehmann 25bc9f1ce7 Merge pull request #184 from yongtang/167-network-inspect-scope
Use scope=swarm for service related network inspect and revendor docker/docker
2017-06-13 14:47:20 -07:00
Yong Tang 657457ee2c Use `scope=swarm` for service related network inspect.
This fix use `scope=swarm` for service related network inspect.
The purpose is that, in case multiple networks with the same
name exist in different scopes, it is still possible to obtain
the network for services.

This fix is related to moby/moby#33630 and docker/cli#167

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-06-13 20:26:12 +00:00
Daniel Nephin 676b71eaaa Fix some problems with image remove force.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-13 12:12:54 -07:00
Arash Deshmeh 006b9b126d fixed the output leak from error test case for config/remove
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-13 12:24:42 -04:00
Vincent Demeester dd924ebf4f
Fix remove_test output duplication
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-13 14:02:56 +02:00
Vincent Demeester ecc8e0a204 Merge pull request #160 from e11137/master
fixes #46 Always exit 0 when remove image with force option
2017-06-13 14:02:02 +02:00
Vincent Demeester dd585ad4fb Merge pull request #172 from adshmh/fix-secret-remove-testcase-error-message-leak
fixed the output leak from the error test case for secret/remove command
2017-06-09 21:03:33 +02:00
Arash Deshmeh 77062a09dc fixed the output leak from secret/remove command error test case
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-09 13:21:14 -04:00
Arash Deshmeh 852bf0f96d removed the output leaked from stack remove error test case
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2017-06-09 12:14:18 -04:00
Victor Vieux a74e715b1a Merge pull request #166 from thaJeztah/update-term
Bump docker/docker to cd35e4beee13a7c193e2a89008cd87d38fcd0161
2017-06-08 13:45:32 -07:00
Aaron Lehmann 4d980880f3 Merge pull request #121 from nishanttotla/digest-pinning-stack-deploy
Enable client side digest pinning for stack deploy
2017-06-08 23:20:02 +03:00
Daniel Nephin 0310de5213 Move IsArchive and HeaderSize to build/context
Previously these were in docker/docker/pkg/archive, but unused

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-08 16:08:11 -04:00
Rogelio Canedo 5c8d702af5 Always exit whith -1 when remove image with force option
Signed-off-by: Rogelio Canedo <rcanedo@mappy.priv>
2017-06-08 20:15:37 +02:00
Sebastiaan van Stijn ab3ea637b6 Merge pull request #111 from keloyang/attach-restarting-check
Add a restarting check to runAttach
2017-06-08 12:53:15 +02:00
Vincent Demeester c944d20b1f Merge pull request #163 from vdemeester/export-convertservice
Update ConvertService for external usage 👼
2017-06-08 10:55:56 +02:00
Vincent Demeester 96dc07a8cf Update ConvertService for external usage 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-08 10:44:05 +02:00
Shukui Yang 90f497302f Add a restarting check to runAttach
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2017-06-08 07:12:39 +08:00
Shukui Yang e8cc2cf760 Replace command.DockerCli to command.Cli in docker attach/exec command
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2017-06-08 07:03:52 +08:00
Nishant Totla f790e839fc
Change --no-resolve-image flag to --resolve-image string flag
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-06-07 12:30:11 -07:00
Nishant Totla 9f1bea2657
Enable client side digest pinning for stack deploy
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-06-07 12:30:11 -07:00
Kenfe-Mickaël Laventure 08cb0bddfd Merge pull request #162 from vdemeester/150-configs-fixes-on-old-daemon
Handle case of configs on old daemon
2017-06-07 12:18:32 -07:00
Aaron Lehmann 9d12d6fc87 Merge pull request #145 from dnephin/improve-compose-secrets-errors
Compose: Improve error messages when resource create/update fails
2017-06-07 18:51:10 +03:00
Vincent Demeester cf5550c426
Handle case of configs on old daemon
If configs are declared for a service and pointing on an old
daemon, error out properly (instead of "page not found").

If there is no configs declared, don't call convertServiceConfigObjs
to avoid having an error.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-07 17:02:46 +02:00
Vincent Demeester 44ac80881f
Update vendoring of docker/docker
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-06 00:23:21 +02:00
Daniel Nephin 3718833f2c Add unit tests for service/ps
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-02 11:29:19 -04:00
Sebastiaan van Stijn a0066a150b Merge pull request #143 from thaJeztah/remove-email-flag
Remove deprecated -e/--email flag from docker login
2017-06-02 08:56:07 +02:00
Daniel Nephin 97ebc19438 Use a map instad of a switch/case for Compose transform.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-01 15:22:09 -04:00
Daniel Nephin 729d07a371 Compose: Improve error messages when resource creation/updates fail.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-01 15:03:04 -04:00
Daniel Nephin 30af87981d Merge pull request #144 from thaJeztah/allow-some-flags-during-rollback
Allow --detach and --quiet flags when using --rollback
2017-06-01 14:47:08 -04:00
Daniel Nephin b5baffde44 Fix complexity of service/ps.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-06-01 11:49:16 -04:00
Brian Goff bf22fc6781 Merge pull request #136 from johnstep/fix_stack_service_volumes
Fix stack compose bind-mount volumes for Windows
2017-06-01 11:06:06 -04:00
Sebastiaan van Stijn f10f29df8d
Allow --detach and --quiet flags when using --rollback
Commit 78c204ef79 added
(f9bd8ec8b268581f93095c5a80679f0a8ff498bf in the moby repo)
a validation to prevent `--rollback` from being used
in combination with other flags that update the
service spec.

This validation was not taking into account that
some flags only affect the CLI behavior, and
are okay to be used when rolling back.

This patch updates the validation, and adds
`--quiet` and `--detach` to the list of allowed
flags.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-01 16:31:07 +02:00
Sebastiaan van Stijn 8b383d2351
Remove deprecated -e/--email flag from docker login
The `docker login -e` / `docker login --email` option was deprecated in
Docker 1.11 (https://github.com/moby/moby/releases/tag/v1.11.0) through
aee260d4eb3aa0fc86ee5038010b7bbc24512ae5 (April 2016), and when used has
been outputing a deprecation warning since;

    Flag --email has been deprecated, will be removed in 17.06.

Originally this option was scheduled to be removed in docker 1.13, but
extended to docker 17.06 due to a change in our deprecation policy.

Given that only docker 1.10 and older use this flag (which is EOL, including
for CS versions, as of February 2017), will now be removed.

With this patch, `docker login` will now produce an Error if the flag
is used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-01 12:55:04 +02:00
John Stephens 9043d39dea
Fix stack compose bind-mount volumes for Windows
For stack compose files, use filepath.IsAbs instead of path.IsAbs, for
bind-mounted service volumes, because filepath.IsAbs handles Windows
paths, while path.IsAbs does not.

Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-31 21:13:58 -07:00
Vincent Demeester efaadcf465 Merge pull request #132 from mavenugo/stack-host
Host and Bridge network support in docker stack deploy
2017-05-31 15:07:56 -07:00
Sebastiaan van Stijn 6279612443
Fix prefix-matching for service ps
The docker CLI matches objects either by ID _prefix_
or a full name match, but not partial name matches.

The correct order of resolution is;

- Full ID match (a name should not be able to mask an ID)
- Full name
- ID-prefix

This patch changes the way services are matched.

Also change to use the first matching service, if there's a
full match (by ID or Name) instead of continue looking for
other possible matches.

Error handling changed;

- Do not error early if multiple services were requested
  and one or more services were not found. Print the
  services that were not found after printing those that
  _were_ found instead
- Print an error if ID-prefix matching is ambiguous

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-05-31 21:43:56 +02:00
Kenfe-Mickaël Laventure f3cb13c550 Merge pull request #118 from cpuguy83/no_prune_volume
Don't prune volumes on `docker system prune`
2017-05-30 10:21:15 -07:00
Brian Goff ebd5191c0e Merge pull request #135 from johnstep/fix_stack_service_configs
Include stack service configs in service specs
2017-05-30 13:17:49 -04:00
Brian Goff 37fd6128dc Don't prune volumes on `docker system prune`
Volumes tend to carry important data and pruning them on `docker system
prune` can easily cause unwanted data loss.

Let's play it safe and not prune volumes on `system prune` by default,
and instead provide an option.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-05-30 12:50:30 -04:00
John Stephens b7cac96f69
Include stack service configs in service specs
Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-26 21:41:04 -07:00
John Stephens f05cd11ee2
Remove stack configs on stack removal
Signed-off-by: John Stephens <johnstep@docker.com>
2017-05-26 18:17:43 -07:00
Marcus Martins 862649707e
Handle a Docker daemon without registry info
The current implementation of the ElectAuthServer doesn't handle well when the
default Registry server is not included in the response from the daemon Info
endpoint.

That leads to the storage and usage of the credentials for the default registry
(`https://index.docker.io/v1/`) under an empty string on the client config file.

Sample config file after a login via a Docker Daemon without Registry
information:
```json
{
	"auths": {
		"": {
			"auth": "***"
		}
	}
}
```

That can lead to duplication of the password for the default registry and
authentication failures against the default registry if a pull/push is performed
without first authenticating via the misbehaving daemon.

Also, changes the output of the warning message from stdout to sdterr as
per dnephin suggestion.

Signed-off-by: Marcus Martins <marcus@docker.com>
2017-05-26 14:46:39 -07:00
Daniel Nephin d5b505ee8c Only set default aliases when the network is user defined.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-26 14:25:20 -04:00
Daniel Nephin 341703d21e Add tests for verifyExternalNetwork
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-26 12:21:04 -04:00
Madhu Venugopal 123f0bfd98 With the introduction of node-local network support, docker services can
be attached to special networks such as host and bridge. This fix brings
in the required changes to make sure the stack file accepts these
networks as well.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-05-25 19:50:08 -07:00
Sebastiaan van Stijn 61c0b9f78d Merge pull request #102 from keloyang/attach-block
Recheck the container's state to avoid attach block.
2017-05-24 12:09:38 +01:00
Josh Soref 70a9905ee5 Spelling fixes
* appropriate
* assumption
* attach
* because
* building
* customized
* mapping
* propagated

Signed-off-by: Josh Soref <jsoref@gmail.com>
2017-05-22 01:39:06 +00:00
Shukui Yang f9dc3337f9 Recheck the container's state to avoid attach block.
If use docker attach command to attach to a stop container, it will return
"You cannot attach to a stopped container" error, it's ok, but when
attach to a running container, it(docker attach) use inspect to check
the container's state, if it pass the state check on the client side,
and then the container is stopped, docker attach command still attach to
the container and not exit.

Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2017-05-20 08:02:06 +08:00
Sebastiaan van Stijn eea4a38cd6 Merge pull request #77 from vdemeester/move-duration-opts
Move duration opts into an opts package
2017-05-18 11:15:30 +02:00
Abhinandan Prativadi 40341ae089 Adding network options to service create/update
Changes added to accept network specific options in
docker service create/update

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-05-17 21:07:48 -07:00
Madhu Venugopal d156151ba1 Merge pull request #49 from aboch/nlo2
Add network create flags --scope, --config-only, --config-from
2017-05-17 20:08:23 -07:00
Sebastiaan van Stijn 74cc280521 Merge pull request #30 from nishanttotla/rename-trust-function
Moving docker service digest pinning to client side
2017-05-18 03:05:48 +02:00
Nishant Totla 39d03bb2bd
Adding a flag to allow disabling registry lookup
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-05-17 17:55:11 -07:00
Nishant Totla c61ea6f789
Service create/update set QueryRegistry appropriately
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-05-17 17:39:35 -07:00
Alessandro Boch b5e43fb5ec Add support for config-only, config-from and scope options
- To promote a network to swarm mode

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-17 17:17:50 -07:00
Sebastiaan van Stijn 85c2330dfa Merge pull request #80 from AkihiroSuda/adjust-docker-stats
[Carry moby/moby#32777] Adjusted docker stats memory output
2017-05-18 01:55:52 +02:00
Sebastiaan van Stijn b3e7e1ff74 Merge pull request #101 from jlhawn/update_container_wait
Update `run` and `start` to use container wait API
2017-05-18 01:31:40 +02:00
Josh Hawn 6eca53c7ae Refactor holdHijackedConnection
It has been refactored to a hijackedIOStreamer type which has several
methods which are used to prepare input and handle streaming the input
and output separately.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2017-05-17 15:18:01 -07:00
Gaetan de Villele 1cc1f54d90 make system prune “--filter” flag available only for docker 17.04 (api v1.28) and newer
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
2017-05-17 12:36:09 -07:00