fix container publish args duplicates - container fails to deploy#415
Conversation
|
|
|
Welcome @loehde! |
|
Hi @loehde. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
You need to sign the CLA Can you also add a regression tests in https://github.com/kubernetes-sigs/cloud-provider-kind/blob/main/tests/tests.bats |
|
/ok-to-test |
|
Hi @aojea, I’ve added a regression test and signed the CLA. :) |
stmcginnis
left a comment
There was a problem hiding this comment.
Some trivial things that aren't too important, but looks good.
/lgtm
| } | ||
|
|
||
| @test "Gateway: Multiple HTTP Listeners on Same Port with enable-lb-port-mapping" { | ||
| # Apply a Gateway with two HTTP listeners on the same port (443) with different |
There was a problem hiding this comment.
nit: Looks like it's actually port 80?
| spec: | ||
| gatewayClassName: cloud-provider-kind | ||
| listeners: | ||
| - protocol: HTTP |
There was a problem hiding this comment.
nit: File is named "https" but looks like we just use http.
|
Thanks! /lgtm |
|
Thank you — happy to help. It’s an awesome project. I have one question, since this is my first time contributing: is there anything further I need to do to get it merged? |
|
/lgtm Thanks |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, loehde The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Bug: duplicate
--publish=443/tcpwhen Gateway has multiple HTTPS listeners on the same portProblem
When a
Gatewaydefines multiple HTTPS listeners on the same port (443) with different hostnames,cloud-provider-kindattempts to create the gateway container with duplicate Docker publish arguments:Docker then fails to create the container with exit status
125.This occurs when the Gateway includes both:
and:
Since both listeners use the same protocol and port, the generated Docker container should only publish port
443/tcponce.Expected behavior
The gateway container should be created successfully.
For multiple listeners using the same protocol and port, the Docker publish argument should be deduplicated, for example:
Actual behavior
Container creation fails because Docker receives duplicate publish arguments:
The controller reports:
Error log
Reproduction
Apply a Gateway with two HTTPS listeners on port
443, one for a wildcard hostname and one for the root hostname.Suggested fix
Deduplicate published container ports when generating the Docker container arguments for Gateway listeners.
The publish list should likely be keyed by protocol and port, rather than by listener, so multiple listeners on the same port only produce one Docker publish argument.