Commit Graph

601 Commits

Author SHA1 Message Date
cbe1e262f7 Merge pull request #974 from simonferquel/compose-kube-env-expansion
[K8s] Do env-variable expansion on the uninterpreted Config files
Upstream-commit: bac0d8f353
Component: cli
2018-05-16 20:18:41 +02:00
7a57bbc2b9 Support multiple namespaces for docker stack ls
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Upstream-commit: 84241cc393
Component: cli
2018-05-15 16:52:21 +02:00
46fae6da7e Support 'all' in orchestrator flag for docker stack ls
All other docker stack commands report an error when passed this value.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Upstream-commit: 4d947de292
Component: cli
2018-05-15 15:38:41 +02:00
09aea6c1ab Merge pull request #1055 from mat007/fix-invalid-orchestrator-silently-ignored
Make an error for an invalid orchestrator
Upstream-commit: 161bc1ed3c
Component: cli
2018-05-14 15:34:01 +02:00
40ccb62e61 Merge pull request #1052 from thaJeztah/fix-rollback-config
Fix service rollback options being cross-wired
Upstream-commit: 74d86d4b2e
Component: cli
2018-05-14 11:01:56 +02:00
fda16ddde1 Merge pull request #1037 from essamhassan/1036_fix_mounts_typo_in_srv_inspect_pretty
use : instead of = in mounts service pretty inspect
Upstream-commit: d4ffd9bc71
Component: cli
2018-05-14 10:55:41 +02:00
3ef5a0bd8a Merge pull request #1038 from kolyshkin/context
Switch from x/net/context to context
Upstream-commit: fd060d2f33
Component: cli
2018-05-11 22:13:52 -04:00
7e8c2b86b6 cli/command/container: don't leak context
Switch from x/net/context to context made "go vet" see the previously
unseen errors:

> cli/command/container/start.go:57::error: the cancelFun function is
> not used on all paths (possible context leak) (vet)
> cli/command/container/start.go:63::error: this return statement may be
> reached without using the cancelFun var defined on line 57 (vet)

> cli/command/container/run.go:159::error: the cancelFun function is not
> used on all paths (possible context leak) (vet)
> cli/command/container/run.go:164::error: this return statement may be
> reached without using the cancelFun var defined on line 159 (vet)

Do call the cancel function.

Note we might end up calling it twice which is fine as long as I can see
from the Go 1.10 source code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 395957155f
Component: cli
2018-05-11 16:50:04 -07:00
32a5db4523 Switch from x/net/context to context
Since go 1.7, "context" is a standard package. Since go 1.9,
x/net/context merely provides some types aliased to those in
the standard context package.

The changes were performed by the following script:

for f in $(git ls-files \*.go | grep -v ^vendor/); do
	sed -i 's|golang.org/x/net/context|context|' $f
	goimports -w $f
	for i in 1 2; do
		awk '/^$/ {e=1; next;}
			/\t"context"$/ {e=0;}
			{if (e) {print ""; e=0}; print;}' < $f > $f.new && \
				mv $f.new $f
		goimports -w $f
	done
done

[v2: do awk/goimports fixup twice]
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6f8070deb2
Component: cli
2018-05-11 16:49:43 -07:00
67fe72ed3d use : instead of = in mounts service pretty inspect
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com>
Upstream-commit: 7285241681
Component: cli
2018-05-12 00:02:18 +02:00
790e355196 Merge pull request #1039 from mat007/fix-filepath-usage
Use filepath.Base instead of path.Base
Upstream-commit: a6b10c2e85
Component: cli
2018-05-11 18:06:23 +02:00
068dc5f571 Make an error for an invalid orchestrator
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Upstream-commit: 50330e7089
Component: cli
2018-05-11 17:19:55 +02:00
e815956d17 Fix service rollback options being cross-wired
The "update" and "rollback" configurations were cross-wired, as a result, setting
`--rollback-*` options would override the service's update-options.

Creating a service with both update, and rollback configuration:

    docker service create \
      --name=test \
      --update-failure-action=pause \
      --update-max-failure-ratio=0.6 \
      --update-monitor=3s \
      --update-order=stop-first \
      --update-parallelism=3 \
      --rollback-failure-action=continue \
      --rollback-max-failure-ratio=0.5 \
      --rollback-monitor=4s \
      --rollback-order=start-first \
      --rollback-parallelism=2 \
      --tty \
      busybox

Before this change:

    docker service inspect --format '{{json .Spec.UpdateConfig}}' test \
    && docker service inspect --format '{{json .Spec.RollbackConfig}}' test

Produces:

    {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}
    {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}

After this change:

    {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}
    {"Parallelism":2,"FailureAction":"continue","Monitor":4000000000,"MaxFailureRatio":0.5,"Order":"start-first"}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f367aa9330
Component: cli
2018-05-11 11:47:05 +02:00
57c3c89455 Make sure every composefiles sent to a v1beta1 endpoint are parsable
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: f766aff716
Component: cli
2018-05-09 13:17:25 -07:00
ec34094dc5 Fix stack ls behaviour with Kubernetes and variout --namespace flag values
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Upstream-commit: 2af66bed41
Component: cli
2018-05-09 17:40:25 +02:00
818645f8cd Add --all-namespaces to docker stack ls command on Kubernetes orchestrator, to list all stacks in all namespaces.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: f097831eb3
Component: cli
2018-05-09 17:33:16 +02:00
f151bd57f8 Add namespace column for docker stack ls command while targeting Kubernetes orchestrator
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 65526a201f
Component: cli
2018-05-09 17:33:16 +02:00
3d9a405e51 Move stack client creation from KubeCli to client factory, where it belongs
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 31dccfffb5
Component: cli
2018-05-09 17:30:37 +02:00
fd51a4f0df Fix using the namespace specified in the kubeconfig file.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: f0aa126b03
Component: cli
2018-05-09 17:30:36 +02:00
572d6e715f Use filepath.Base instead of path.Base
This ensures Windows paths are handled correctly as explained in the path package documentation.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
Upstream-commit: 698ea75c66
Component: cli
2018-05-07 17:25:23 +02:00
3d4a877b7f Merge pull request #1006 from essamhassan/908_show_secrets_configs_srv_inspect
908 - Adding configs/secrets to service inspect pretty
Upstream-commit: e9731e9d0f
Component: cli
2018-05-03 10:12:51 +02:00
8fa7a28767 Merge pull request #1026 from dhiltgen/expose_pull
Export pull as a public function
Upstream-commit: 784430737b
Component: cli
2018-05-02 12:07:49 +02:00
09778021e4 Merge pull request #1024 from clnperez/manifest-token-perms
manifest list: request specific permissions
Upstream-commit: f42c66bd24
Component: cli
2018-04-30 20:22:11 +02:00
2ff7c2ca43 Add an orchestrator column in the docker stack ls command
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 13d0c9c695
Component: cli
2018-04-30 12:04:02 +02:00
d432dda560 Print warnings on stderr for each unsupported features while parsing a compose file for deployment on Kubernetes.
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 36591a2282
Component: cli
2018-04-30 11:56:14 +02:00
de5526bad9 Add a common interface between different Kubernetes Stack API versions and use it in kubernetes stack commands
* Add kubernetes Stack API v1beta2 client
* Upgrade v1beta1 client to remove generated code

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: f958c66a6d
Component: cli
2018-04-30 11:27:22 +02:00
240bba4fdb Export pull as a public function
It will be helpful to expose the pull implementation which supports
pulling private images for other CLI commands that rely on helper images.

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
Upstream-commit: 812f113685
Component: cli
2018-04-27 12:21:19 -07:00
08243ac4d3 testing config/secrets are showing in pretty print
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com>
Upstream-commit: 8238644796
Component: cli
2018-04-25 17:22:18 +02:00
9193280536 add config and secret to service in inspect test
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com>
Upstream-commit: 2b1f27ea5e
Component: cli
2018-04-25 17:22:18 +02:00
8531403103 adding configs/secrets to service inspect pretty
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com>
Upstream-commit: 3ae2d4b24c
Component: cli
2018-04-25 17:21:31 +02:00
89facafb80 specify specific permissions
When creating manifest lists, don't use "*" as the permission when
creating the token handler. This causes problems with gitlab's repos.

Fixes https://github.com/docker/cli/issues/1010

Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
Upstream-commit: c26e2264fb
Component: cli
2018-04-24 17:01:57 -05:00
e92b784d10 Cleaning some manifest documentation typos
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 55c5e7aa88
Component: cli
2018-04-24 15:00:39 +02:00
637cb9eba9 Remove more TODOs
- Some of them don't make sense anymore
- Some are deprecated and removed from the engine since a few versions
  already.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 740d260cd2
Component: cli
2018-04-23 14:57:29 +02:00
afba3f7a60 Handle some TODOs in tests
Use more gotestyourself for `env.Patch`, and `icmd.RunCommand`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ae03dd7f46
Component: cli
2018-04-23 14:13:52 +02:00
46a62eba1d Revert unencryted storage warning prompt
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
Upstream-commit: 3acf5d2e47
Component: cli
2018-04-16 12:48:03 -07:00
944c468f43 Merge pull request #963 from thaJeztah/fix-stack-deploy-after-force
Fix stack deploy re-deploying service after --force
Upstream-commit: 6b31ea0f0d
Component: cli
2018-04-13 13:06:40 -10:00
37bdc4a0ae Fixed gometalinter errors on test files
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 54f8ca6660
Component: cli
2018-04-10 16:03:56 +02:00
a5ee15c5ef Merge pull request #978 from bogdananton/fix-manifest-docs-typo
[docs] Fix typo in manifest command docs: updated `MANFEST` to `MANIFEST`.
Upstream-commit: 066fd62e37
Component: cli
2018-04-09 13:25:37 -07:00
96e7de35a2 Fix error with merge composefile with networks…
… and other cases too. Updating mergo fixes the bugs (but introduced a
slight behaviour change that had to be fixed too)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0122730faf
Component: cli
2018-04-05 10:37:35 +02:00
5392f72ea0 [docs] Fix typo in manifest command docs: updated MANFEST to MANIFEST.
Signed-off-by: Bogdan Anton <contact@bogdananton.ro>
Upstream-commit: 9fa6bd4174
Component: cli
2018-04-01 17:40:31 +03:00
5f335fa91f Merge pull request #965 from thaJeztah/fix-version-output
Fix docker version output alignment
Upstream-commit: eb4a4fe9b9
Component: cli
2018-03-28 09:53:34 +02:00
0ff4beab6e vendor: update moby to ed7b6428
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a1cbaa827b
Component: cli
2018-03-27 14:11:29 -07:00
610793fe1f Merge pull request #561 from tych0/deprecate-unencrypted-storage
Deprecate unencrypted storage
Upstream-commit: e6e47d95b5
Component: cli
2018-03-27 14:52:03 +02:00
e985ce6103 Merge pull request #941 from dnephin/fix-compose-network-name
Fix compose network name
Upstream-commit: 236a84759a
Component: cli
2018-03-26 23:41:44 +02:00
5d37083ce3 Refactor build tests to re-use more code and not require root
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0f1bb35342
Component: cli
2018-03-26 14:27:52 -04:00
35825c3260 Fix docker version output alignment
Use tabwriter to print the version output

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 48eb7a082d
Component: cli
2018-03-26 17:59:20 +02:00
72976c8bb6 print a big warning about cleartext passwords
Signed-off-by: Tycho Andersen <tycho@docker.com>
Upstream-commit: 4290df3958
Component: cli
2018-03-26 16:18:32 +02:00
9166a5d3e5 Fix stack deploy re-deploying service after --force
When updating a service with the `--force` option, the `ForceUpdate`
property of the taskspec is incremented.

Stack deploy did not take this into account, and reset this
field to its default value (0), causing the service to be
re-deployed.

This patch copies the existing value before updating the service.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 76439457d2
Component: cli
2018-03-26 15:24:28 +02:00
e222bd5a48 Merge pull request #943 from silvin-lubecki/fix-kubernetes-published-service
Fix docker stack services command Port output
Upstream-commit: 27f66e39f4
Component: cli
2018-03-26 12:50:07 +01:00
86110646cc Fix Kubernetes duplication in version command when the server already exposes one Kubernetes component
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: 54bb5ffeca
Component: cli
2018-03-23 15:52:25 +01:00