Skip to content

Fix presentation of published "random" host ports#404

Merged
vdemeester merged 1 commit into
docker:masterfrom
thaJeztah:fix-port-presentation
Aug 1, 2017
Merged

Fix presentation of published "random" host ports#404
vdemeester merged 1 commit into
docker:masterfrom
thaJeztah:fix-port-presentation

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

fixes #402

Ports that were picked from the ephemeral port range were presented as *:0->80/tcp.

This patch changes the presentation to use the actually assigned port, instead of the port specified in Endpoint.Spec (which is always empty/zero (0))

Before this change;

ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:0->80/tcp

After this change;

ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:30000->80/tcp

Ports that were picked from the ephemeral port range
were presented as `*:0->80/tcp`.

This patch changes the presentation to use the
actually assigned port, instead of the port specified
in `Endpoint.Spec` (which is always empty/zero (`0`))

Before this change;

    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:0->80/tcp

After this change;

    ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
    5d44i665qj66        with-random-port    replicated          1/1                 nginx:alpine        *:30000->80/tcp

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@codecov-io

codecov-io commented Aug 1, 2017

Copy link
Copy Markdown

Codecov Report

Merging #404 into master will not change coverage.
The diff coverage is 50%.

@@          Coverage Diff           @@
##           master    #404   +/-   ##
======================================
  Coverage    46.2%   46.2%           
======================================
  Files         193     193           
  Lines       16092   16092           
======================================
  Hits         7435    7435           
  Misses       8270    8270           
  Partials      387     387

@dnephin dnephin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdemeester vdemeester left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐸

@vdemeester vdemeester merged commit 772956b into docker:master Aug 1, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.08.0 milestone Aug 1, 2017
@thaJeztah thaJeztah deleted the fix-port-presentation branch August 1, 2017 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Presentation of host-port of services with a randomly assigned port is incorrect

5 participants