Sebastiaan van Stijn
27c0858f43
Fix service update --host-rm not being granular enough
...
Removing a host by `<host>:<ip>` should only remove occurences of the host with
a matching IP-address, instead of removing all entries for that host.
In addition, combining `--host-rm` and `--host-add` for the same host should
result in the new host being added.
This patch fixes the way the diff is calculated to allow combining
removing/adding, and to support entries having both a canonical, and aliases.
Aliases cannot be added by the CLI, but are supported in the Service spec, thus
should be taken into account:
Entries can be removed by either a specific `<host-name>:<ip-address>`
mapping, or by `<host>` alone:
- If both IP-address and host-name is provided, only remove the hostname
from entries that match the given IP-address.
- If only a host-name is provided, remove the hostname from any entry it
is part of (either as _canonical_ host-name, or as _alias_).
- If, after removing the host-name from an entry, no host-names remain in
the entry, the entry itself should be removed.
For example, the list of host-entries before processing could look like this:
hosts = &[]string{
"127.0.0.2 host3 host1 host2 host4",
"127.0.0.1 host1 host4",
"127.0.0.3 host1",
"127.0.0.1 host1",
}
Removing `host1` removes every occurrence:
hosts = &[]string{
"127.0.0.2 host3 host2 host4",
"127.0.0.1 host4",
}
Whereas removing `host1:127.0.0.1` only remove the host if the IP-address matches:
hosts = &[]string{
"127.0.0.2 host3 host1 host2 host4",
"127.0.0.1 host4",
"127.0.0.3 host1",
}
Before this patch:
$ docker service create --name my-service --host foo:127.0.0.1 --host foo:127.0.0.2 --host foo:127.0.0.3 nginx:alpine
$ docker service update --host-rm foo:127.0.0.1 --host-add foo:127.0.0.4 my-service
$ docker service inspect --format '{{.Spec.TaskTemplate.ContainerSpec.Hosts}}' my-service
[]
After this patch is applied:
$ docker service create --name my-service --host foo:127.0.0.1 --host foo:127.0.0.2 --host foo:127.0.0.3 nginx:alpine
$ docker service update --host-rm foo:127.0.0.1 --host-add foo:127.0.0.5 my-service
$ docker service inspect --format '{{.Spec.TaskTemplate.ContainerSpec.Hosts}}' my-service
[127.0.0.2 foo 127.0.0.3 foo 127.0.0.4 foo]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2018-05-11 16:35:19 +02:00
Sebastiaan van Stijn
ab1d49a313
Merge pull request #1047 from eightlimbed/eightlimbed-patch-1
...
fixed typo
2018-05-10 10:32:07 +02:00
Sebastiaan van Stijn
552ee502f7
Merge pull request #991 from silvin-lubecki/kubernetes-namespace
...
Better namespace experience with Kubernetes
2018-05-09 21:18:50 +02:00
Mathieu Champlon
2af66bed41
Fix stack ls behaviour with Kubernetes and variout --namespace flag values
...
Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com >
2018-05-09 17:40:25 +02:00
Silvin Lubecki
f097831eb3
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 >
2018-05-09 17:33:16 +02:00
Silvin Lubecki
65526a201f
Add namespace column for docker stack ls command while targeting Kubernetes orchestrator
...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com >
2018-05-09 17:33:16 +02:00
Silvin Lubecki
31dccfffb5
Move stack client creation from KubeCli to client factory, where it belongs
...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com >
2018-05-09 17:30:37 +02:00
Silvin Lubecki
c23c1482c7
Clean useless named imports
...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com >
2018-05-09 17:30:36 +02:00
Silvin Lubecki
f0aa126b03
Fix using the namespace specified in the kubeconfig file.
...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com >
2018-05-09 17:30:36 +02:00
Lee Gaines
9570911807
fixed typo -- Signed-off-by: Lee Gaines <eightlimbed@gmail.com>
2018-05-08 14:46:42 -07:00
Sebastiaan van Stijn
c31b61bff4
Merge pull request #818 from selansen/master
...
Allow user to specify default address pools for docker networks
2018-05-08 14:17:00 +02:00
selansen
75c7b95e7a
Allow user to specify default address pools for docker networks
...
This is separate commit for CLI files to address PR 36054
Signed-off-by: selansen <elango.siva@docker.com >
2018-05-05 19:46:28 -04:00
Tibor Vass
0ff5f52051
Merge pull request #922 from kolyshkin/man-fixes
...
Man page fixes
2018-05-03 07:34:06 -10:00
Vincent Demeester
e956159572
Merge pull request #1005 from eiais/fishupdate
...
Update Attach, Build, Commit, Cp, Create subcommand fish completions
2018-05-03 10:28:53 +02:00
Vincent Demeester
e9731e9d0f
Merge pull request #1006 from essamhassan/908_show_secrets_configs_srv_inspect
...
908 - Adding configs/secrets to service inspect pretty
2018-05-03 10:12:51 +02:00
Victor Vieux
222b0245f7
Merge pull request #1030 from thaJeztah/bump-version-to-v18.06-dev
...
Bump version to 18.06.0-dev
2018-05-02 11:39:52 -07:00
Sebastiaan van Stijn
deb8bd740b
Bump version to 18.06.0-dev
...
Docker-CE 18.05.0-rc1 was cut off from these commits;
- docker-ce 18.05 branch created for code freeze: https://github.com/docker/docker-ce/tree/18.05
- engine: https://github.com/moby/moby/tree/1a57535
- cli: https://github.com/docker/cli/tree/4970824
- packaging: https://github.com/docker/docker-ce-packaging/tree/c216602
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2018-05-02 12:11:23 +02:00
Sebastiaan van Stijn
784430737b
Merge pull request #1026 from dhiltgen/expose_pull
...
Export pull as a public function
2018-05-02 12:07:49 +02:00
Sebastiaan van Stijn
f42c66bd24
Merge pull request #1024 from clnperez/manifest-token-perms
...
manifest list: request specific permissions
2018-04-30 20:22:11 +02:00
Sebastiaan van Stijn
8103326311
Merge pull request #1028 from nstapelbroek/feature/exec-die-event
...
Add exec_die to the list of known container events
2018-04-30 12:26:28 +02:00
Sebastiaan van Stijn
3a55cd709c
Merge pull request #973 from silvin-lubecki/orchestrator-column
...
Orchestrator column
2018-04-30 12:16:41 +02:00
Silvin Lubecki
13d0c9c695
Add an orchestrator column in the docker stack ls command
...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com >
2018-04-30 12:04:02 +02:00
Sebastiaan van Stijn
8963ab993e
Merge pull request #903 from silvin-lubecki/add-warnings-client-side
...
Add warnings client side before deployment on Kubernetes
2018-04-30 12:01:55 +02:00
Silvin Lubecki
36591a2282
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 >
2018-04-30 11:56:14 +02:00
Sebastiaan van Stijn
7ad30360c8
Merge pull request #899 from silvin-lubecki/handle-multiple-stack-api-versions
...
Handle multiple stack api versions
2018-04-30 11:33:04 +02:00
Silvin Lubecki
f958c66a6d
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 >
2018-04-30 11:27:22 +02:00
Nico Stapelbroek
4d91812b88
Add exec_die to the list of known container events
...
Signed-off-by: Nico Stapelbroek <nstapelbroek@gmail.com >
2018-04-29 14:52:08 +02:00
Daniel Hiltgen
812f113685
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 >
2018-04-27 12:21:19 -07:00
Brian Goff
99bd7ed693
Merge pull request #1017 from thaJeztah/warn-when-using-host-ip
...
Warn when using host-ip for published ports
2018-04-25 17:09:42 -04:00
Essam A. Hassan
8238644796
testing config/secrets are showing in pretty print
...
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com >
2018-04-25 17:22:18 +02:00
Essam A. Hassan
2b1f27ea5e
add config and secret to service in inspect test
...
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com >
2018-04-25 17:22:18 +02:00
Essam A. Hassan
3ae2d4b24c
adding configs/secrets to service inspect pretty
...
Signed-off-by: Essam A. Hassan <es.hassan187@gmail.com >
2018-04-25 17:21:31 +02:00
Christy Norman
c26e2264fb
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 >
2018-04-24 17:01:57 -05:00
Sebastiaan van Stijn
4970824bea
Merge pull request #1022 from silvin-lubecki/clean-manifest-documentation
...
Cleaning some manifest documentation typos
2018-04-24 17:07:14 +02:00
Silvin Lubecki
55c5e7aa88
Cleaning some manifest documentation typos
...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com >
2018-04-24 15:00:39 +02:00
Brian Goff
c889ea1bca
Merge pull request #1020 from vdemeester/todo-tada
...
Handle some TODOs in tests
2018-04-23 09:33:41 -04:00
Vincent Demeester
740d260cd2
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 >
2018-04-23 14:57:29 +02:00
Vincent Demeester
58173b3c69
Remote FIXME(s) in vendor.conf
...
It's coming from dependencies, doesn't make sense here
Signed-off-by: Vincent Demeester <vincent@sbr.pm >
2018-04-23 14:14:45 +02:00
Vincent Demeester
ae03dd7f46
Handle some TODOs in tests
...
Use more gotestyourself for `env.Patch`, and `icmd.RunCommand`
Signed-off-by: Vincent Demeester <vincent@sbr.pm >
2018-04-23 14:13:52 +02:00
Silvin
c790f387e1
Merge pull request #1011 from vdemeester/mark-test-helpers
...
Make testing helpers as such…
2018-04-23 11:20:12 +02:00
Sebastiaan van Stijn
363335ec9b
Warn when using host-ip for published ports
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2018-04-21 12:49:47 -07:00
Kyle Spiers
b491ad1589
update docker Create subcommand fish completions
...
Signed-off-by: Kyle Spiers <kyle@spiers.me >
2018-04-20 12:09:44 -07:00
Kyle Spiers
49d8604875
update docker Cp subcommand fish completions
...
Signed-off-by: Kyle Spiers <kyle@spiers.me >
2018-04-20 11:58:05 -07:00
Kyle Spiers
67a80e3c89
update docker Commit subcommand fish completions
...
Signed-off-by: Kyle Spiers <kyle@spiers.me >
2018-04-20 11:57:33 -07:00
Kyle Spiers
44168f52b3
update docker Build subcommand fish completions
...
Signed-off-by: Kyle Spiers <kyle@spiers.me >
2018-04-20 11:56:09 -07:00
Kyle Spiers
ee5aad8646
update docker Attach subcommand fish completions
...
Signed-off-by: Kyle Spiers <kyle@spiers.me >
2018-04-20 11:48:57 -07:00
Sebastiaan van Stijn
6c9232a568
Merge pull request #1013 from thaJeztah/update-authors
...
Update AUTHORS and mailmap
2018-04-18 13:46:30 -07:00
Brian Goff
01778ee9d5
Merge pull request #1012 from thaJeztah/add-silvin-maintainer
...
Add Silvin as maintainer
2018-04-18 16:35:40 -04:00
Sebastiaan van Stijn
a761eff8c5
Update AUTHORS and mailmap
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2018-04-18 13:31:07 -07:00
Sebastiaan van Stijn
60b371506c
Add Silvin as maintainer
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2018-04-18 13:21:33 -07:00