Skip to content
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 #1835

Merged
merged 1 commit into from
Jan 10, 2017

Commits on Jan 7, 2017

  1. Fix issues of multiple published ports mapping to the same target port

    This fix tries to address the issue raised in moby/moby#29370
    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.
    
    A test case has been added in the unit test. The newly added test case
    will only work with this PR.
    
    Signed-off-by: Yong Tang <[email protected]>
    yongtang committed Jan 7, 2017
    Configuration menu
    Copy the full SHA
    5fe66da View commit details
    Browse the repository at this point in the history