-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ps: fix display of exposed ports #24337
Conversation
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.
Tests LGTM.
@@ -396,12 +396,20 @@ var _ = Describe("Podman run networking", func() { | |||
name := "testctr" | |||
session := podmanTest.Podman([]string{"create", "-t", "--expose", "80", "-p", "80", "--name", name, ALPINE, "/bin/sh"}) | |||
session.WaitWithDefaultTimeout() | |||
Expect(session).Should(ExitCleanly()) |
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.
nice catch
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
session.WaitWithDefaultTimeout() | ||
Expect(session).Should(ExitCleanly()) | ||
// This must use Equal() to ensure we do not see the extra ", 80/tcp" from the exposed port | ||
Expect(session.OutputToString()).To(Equal("0.0.0.0:" + hostPort + "->80/tcp")) |
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.
Should we have a test with a port range?
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.
I added sufficient unit tests IMO, but I can add more int test if wanted. I do agree that expose with ranges seems to have very little e2e tests (one, two if we could the ones form the image)
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.
added more tests
This can never included a comma in the protocol so it just complicated things for no reason, we never needed this and commit edc3dc5 already ensures this cannot happen. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This fixes two problems, first if a port is published and exposed it should not be shown twice. It is enough to show the published one. Second, if there is a huge range the ports were no grouped causing the output to be unreadable basically. Now we group exposed ports like we do with the normal published ports. Fixes containers#23317 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
f4eee7f
to
0cdb9b3
Compare
LGTM |
/lgtm |
This fixes two problems, first if a port is published and exposed it
should not be shown twice. It is enough to show the published one.
Second, if there is a huge range the ports were no grouped causing the
output to be unreadable basically. Now we group exposed ports like we do
with the normal published ports.
Fixes #23317
Does this PR introduce a user-facing change?