Skip to content

Commit ae66cfe

Browse files
authored
Merge pull request kubernetes#125872 from aroradaman/fix-e2e-etp-local-lb
e2e/network/lb: fix url formatting for ipv6
2 parents 0d3b859 + 6605afe commit ae66cfe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/e2e/framework/network/utils.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,8 @@ func (config *NetworkingTestConfig) GetResponseFromTestContainer(ctx context.Con
457457

458458
// GetHTTPCodeFromTestContainer executes a curl via kubectl exec in a test container and returns the status code.
459459
func (config *NetworkingTestConfig) GetHTTPCodeFromTestContainer(ctx context.Context, path, targetIP string, targetPort int) (int, error) {
460-
cmd := fmt.Sprintf("curl -g -q -s -o /dev/null -w %%{http_code} http://%s:%d%s",
461-
targetIP,
462-
targetPort,
460+
cmd := fmt.Sprintf("curl -g -q -s -o /dev/null -w %%{http_code} http://%s%s",
461+
net.JoinHostPort(targetIP, strconv.Itoa(targetPort)),
463462
path)
464463
stdout, stderr, err := e2epod.ExecShellInPodWithFullOutput(ctx, config.f, config.TestContainerPod.Name, cmd)
465464
// We only care about the status code reported by curl,

0 commit comments

Comments
 (0)