-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--publish-rm on service update should error if the port isn't a target port #25338
Comments
Thanks for opening! I think what we need, is a design decision (and document) about how we want these to act, so that we can be consistent. Given the overall design of Swarm mode, making actions idempotent could also make sense (the desired state is to un-publish port 8080). (Similarly, there have been discussions about producing errors for invalid configuration changes; this is tricky because that can only be done for configuration that can never become valid, which may depend on the platform the daemon runs on) /cc @aluzzardi @vieux |
Yes, I think this should be idempotent. We could add a warning to inform users, but I don't think it should error. |
Perhaps we should add a generic message "nothing to update" if an update action didn't lead to changes in the service definition. Interesting; I think we should fix this: $ docker service update --publish-add 80:80 web
web
$ docker service update --publish-add 80:80 web
Error response from daemon: rpc error: code = 3 desc = EndpointSpec: duplicate ports provided |
Opened an issue for that: #25375 |
For
? |
@yongtang We should be very careful with adding a new syntax; we've been bitten by bad decisions in that area before (e.g. the completely overloaded syntax on |
@thaJeztah Yes we definitely should be very careful about the UI/UX. I noticed only very recently that there are some potential confusions with respect to
I think having a verbose (and less confusion) option is much better. That should help address the issue of the above (e.g., remove UDP vs TCP inadvertently.) |
@thaJeztah Here is an related issue (moby/swarmkit#1396) in swarmkit. |
Yes, I think that already works, it just defaults to |
Thanks @dnephin! I didn't notice the equalPort before. It looks like equalPort may not cover the case where I created a pull request #25860 to update the Please take a look and let me know if there are any issues or if there are better ways. |
…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: moby/swarmkit#1396 moby#25200 (comment) moby#25338 (comment) 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): moby/swarmkit#1396 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
…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: moby/swarmkit#1396 moby#25200 (comment) moby#25338 (comment) 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): moby/swarmkit#1396 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
…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: moby/swarmkit#1396 moby/moby#25200 (comment) moby/moby#25338 (comment) 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): moby/swarmkit#1396 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
…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: moby/swarmkit#1396 moby/moby#25200 (comment) moby/moby#25338 (comment) 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): moby/swarmkit#1396 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 8597e231a5caa23247934f7a89c1001d87e26192 Component: cli
…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: moby/swarmkit#1396 moby/moby#25200 (comment) moby/moby#25338 (comment) 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): moby/swarmkit#1396 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 1b400f6284b17fffa0495e1c801155fdd0716e98 Component: cli
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Steps to reproduce the issue:
docker swarm init
docker network create -d overlay backend
docker service create --name nginx --network backend --publish 8088:80 nginx
docker service update --publish-rm 8088 nginx
Describe the results you received:
Describe the results you expected:
Since 8088 is the published port, not the target port that
--publish-rm
expects it should error out instead of acting like it's working but not.The text was updated successfully, but these errors were encountered: