-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Fix issues of multiple published ports mapping to the same target port #29787
Merged
vdemeester
merged 2 commits into
moby:master
from
yongtang:29730-multiple-published-port
Jan 10, 2017
Merged
Fix issues of multiple published ports mapping to the same target port #29787
vdemeester
merged 2 commits into
moby:master
from
yongtang:29730-multiple-published-port
Jan 10, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yongtang
force-pushed
the
29730-multiple-published-port
branch
from
January 2, 2017 13:10
f74412a
to
0a9348d
Compare
yongtang
force-pushed
the
29730-multiple-published-port
branch
3 times, most recently
from
January 7, 2017 01:46
da44fdd
to
98edb4c
Compare
This fix tries to address the issue raised in docker/docker-29730 where a service with multiple published ports mapping to the same target port (e.g., `--publish 5000:80 --publish 5001:80`) can't be allocated. The reason for the issue is that, `getPortConfigKey` is used for both allocated ports and configured (may or may not be allocated) ports. However, `getPortConfigKey` will not take into consideration the `PublishedPort` field, which actually could be different for different allocated ports. This fix saves a map of `portKey:portNum:portState`, instead of currently used `portKey:portState` so that multiple published ports could be processed. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit updates swarmkit to c971468 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
yongtang
force-pushed
the
29730-multiple-published-port
branch
from
January 10, 2017 11:47
98edb4c
to
f3a274f
Compare
Updated the PR to vendor c971468. /cc @aaronlehmann @thaJeztah @aboch Please take a look. |
thaJeztah
approved these changes
Jan 10, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
vdemeester
approved these changes
Jan 10, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🦁
cherry-picked through #31143 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fix tries to address the issue raised in #29730 where a service with multiple published ports mapping to the same target port (e.g.,
--publish 5000:80 --publish 5001:80
) can't be allocated.The reason for the issue is that,
getPortConfigKey
is used for both allocated ports and configured (may or may not be allocated) ports. However,getPortConfigKey
will not take into consideration thePublishedPort
field, which actually could be different for different allocated ports.This fix saves a map of
portKey:portNum:portState
, instead of currently usedportKey:portState
so that multiple published ports could be processed.An integration test has been added to address moby/swarmkit#1835 (comment)
See moby/swarmkit#1835 for changes in SwarmKit.
This fix fixes #29730
Signed-off-by: Yong Tang yong.tang.github@outlook.com