1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/opts
Yong Tang c4d773cdfe 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>
2016-12-01 17:46:53 -08:00
..
hosts.go Fix opts tests after default port fix 2016-06-21 17:14:55 -07:00
hosts_test.go Fix opts tests after default port fix 2016-06-21 17:14:55 -07:00
hosts_unix.go Finish linting opts and trust package. 2015-08-27 17:36:11 +02:00
hosts_windows.go Windows: Default to npipe transport 2016-03-01 18:27:01 -08:00
ip.go Convert dockerd to use cobra and pflag 2016-08-25 13:09:03 -04:00
ip_test.go golint: trust 2015-08-27 11:40:27 +02:00
mount.go opts/mount: add tmpfs-specific options 2016-11-09 02:01:53 +00:00
mount_test.go opts/mount: add tmpfs-specific options 2016-11-09 02:01:53 +00:00
opts.go Return error for incorrect argument of service update --publish-rm <TargetPort> 2016-12-01 17:46:53 -08:00
opts_test.go fix t.Errorf to t.Error in serveral _test.go 2016-11-14 17:54:43 +08:00
opts_unix.go Windows [TP4] localhost mitigation 2015-11-06 13:52:59 -08:00
opts_windows.go Windows: Remove TP4 support from main code 2016-04-06 12:12:20 -07:00
port.go fix a few golint errors 2016-11-18 18:32:02 -08:00
secret.go SecretRequestOptions -> SecretRequestOption 2016-11-09 14:27:45 -05:00
secret_test.go secrets: support simple syntax --secret foo 2016-11-09 14:27:45 -05:00