Merge pull request #125872 from aroradaman/fix-e2e-etp-local-lb

e2e/network/lb: fix url formatting for ipv6
This commit is contained in:
Kubernetes Prow Robot 2024-07-03 10:39:51 -07:00 committed by GitHub
commit ae66cfe582
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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