-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Kube Play - allow setting and overriding published host ports #16880
Kube Play - allow setting and overriding published host ports #16880
Conversation
This PR is the first step in addressing #16595 |
3e86976
to
42a00be
Compare
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
@Luap99 @umohnani8 PTAL
42a00be
to
4bd3e46
Compare
// The error message is printed only on local call | ||
if !IsRemote() { | ||
Expect(kube.OutputToString()).Should(ContainSubstring("rootlessport cannot expose privileged port 80")) | ||
} |
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.
this is a bug and should be fixed? assuming this is already the case before this PR could you fill a issue for it
bc11c51
to
5021458
Compare
I've fixed the code according to the comments. But, I think we need to align the functionality between the two changes this and #16766 before we proceed with either of them |
5021458
to
a8976b4
Compare
a8976b4
to
0b44907
Compare
A number of red tests. The changes LGTM in general, I'll let others decide on the thumb-wrestling between this and #16766 |
0b44907
to
48d9973
Compare
@Luap99 I've fixed the code according to your comment. Please see my explanation here: #16880 (comment). |
48d9973
to
a50b51c
Compare
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.
mostly looks good, the test should make sure both ports are present
kube := podmanTest.Podman([]string{"play", "kube", "--publish", "19007:80/udp", kubeYaml}) | ||
kube.WaitWithDefaultTimeout() | ||
Expect(kube).Should(Exit(0)) | ||
|
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.
this needs an inspect or something to make sure that both ports are defined, your test only check for the tcp port below
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 changed the test to test both UDP and TCP connections. So, I guess there's no need for inspect, right?
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.
sure that works too
kube := podmanTest.Podman([]string{"play", "kube", "--publish", "19010:19008/tcp", kubeYaml}) | ||
kube.WaitWithDefaultTimeout() | ||
Expect(kube).Should(Exit(0)) | ||
|
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.
same here
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 changed the test to test both UDP and TCP connections. So, I guess there's no need for inspect, right?
pkg/domain/infra/abi/play.go
Outdated
for _, publishedPort := range publishedPorts { | ||
if port.ContainerPort >= publishedPort.ContainerPort && port.ContainerPort < publishedPort.ContainerPort+publishedPort.Range && isSamePortProtocol(port.Protocol, publishedPort.Protocol) { | ||
return true | ||
|
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.
necessary newline
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.
Right, fixed
46676b2
to
f8b0959
Compare
/approve |
@containers/podman-maintainers The tests pass locally. Looking at the failure logs, it seems that the containers are started successfully, but then the test code fails to connect to the port. In addition, other flavors of the suite pass. So, it might be a difference in the setup that causes the failures. Can you think of a reason why they fail in the CI? |
CI systems are always much slower compared to local. You need to add some retry mechanism for the connect in the test. If we do a podman/test/e2e/network_test.go Lines 514 to 526 in 98d95f0
|
f8b0959
to
16ff0bc
Compare
@Luap99 Thanks for the tip. I've updated the test code |
16ff0bc
to
6596dcb
Compare
Lint is not happy with this change. |
Add a new flag --publish Remote - Pass PublishPorts as a string array ABI - translate the string array to Ports and merge with the ports in the spec Add e2e tests Add option to man doc Signed-off-by: Ygal Blum <[email protected]>
6596dcb
to
07cc49e
Compare
Thanks, fixed |
@containers/podman-maintainers can someone please restart the failed test. This time it is unrelated to my changes |
Done |
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
/lgtm |
@Luap99 I've made all the change and all tests are done and passing, but the PR still has the "Changes requested" state. Can you please re-review? |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, rhatdan, ygalblum 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 |
/hold cancel |
/cherry-pick v4.4 |
@baude: #16880 failed to apply on top of branch "v4.4":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This is already in the v4.4 branch |
Does this PR introduce a user-facing change?
Yes