DockerCLI/opts
Yong Tang 1b400f6284 Return error for incorrect argument of `service update --publish-rm <TargetPort>`
Currently `--publish-rm` only accepts `<TargetPort>` or `<TargetPort>[/Protocol]`
though there are some confusions.

Since `--publish-add` accepts `<PublishedPort>:<TargetPort>[/Protocol]`, some user
may provide `--publish-rm 80:80`. However, there is no error checking so the incorrect
provided argument is ignored silently.

This fix adds the check to make sure `--publish-rm` only accepts `<TargetPort>[/Protocol]`
and returns error if the format is invalid.

The `--publish-rm` itself may needs to be revisited to have a better UI/UX experience,
see discussions on:
https://github.com/docker/swarmkit/issues/1396
https://github.com/docker/docker/issues/25200#issuecomment-236213242
https://github.com/docker/docker/issues/25338#issuecomment-240787002

This fix is short term measure so that end users are not misled by the silently ignored error
of `--publish-rm`.

This fix is related to (but is not a complete fix):
https://github.com/docker/swarmkit/issues/1396

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-05-15 11:57:20 +02:00
..
hosts.go Fix opts tests after default port fix 2017-05-15 11:57:19 +02:00
hosts_test.go Fix opts tests after default port fix 2017-05-15 11:57:19 +02:00
hosts_unix.go Finish linting opts and trust package. 2017-05-15 11:57:15 +02:00
hosts_windows.go Windows: Default to npipe transport 2017-05-15 11:57:18 +02:00
ip.go Convert dockerd to use cobra and pflag 2017-05-15 11:57:19 +02:00
ip_test.go golint: trust 2017-05-15 11:57:15 +02:00
mount.go opts/mount: add tmpfs-specific options 2017-05-15 11:57:19 +02:00
mount_test.go opts/mount: add tmpfs-specific options 2017-05-15 11:57:19 +02:00
opts.go Return error for incorrect argument of `service update --publish-rm <TargetPort>` 2017-05-15 11:57:20 +02:00
opts_test.go fix t.Errorf to t.Error in serveral _test.go 2017-05-15 11:57:20 +02:00
opts_unix.go Windows [TP4] localhost mitigation 2017-05-15 11:57:16 +02:00
opts_windows.go Windows: Remove TP4 support from main code 2017-05-15 11:57:18 +02:00
port.go fix a few golint errors 2017-05-15 11:57:20 +02:00
secret.go SecretRequestOptions -> SecretRequestOption 2017-05-15 11:57:20 +02:00
secret_test.go secrets: support simple syntax --secret foo 2017-05-15 11:57:19 +02:00