diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index 35d6ced59b8..84252336c6c 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -458,7 +458,7 @@ var _ = SIGDescribe("Kubectl client", func() { } // Verify the proxy server logs saw the connection - expectedProxyLog := fmt.Sprintf("Accepting CONNECT to %s", strings.TrimRight(strings.TrimLeft(framework.TestContext.Host, "https://"), "/api")) + expectedProxyLog := fmt.Sprintf("Accepting CONNECT to %s", strings.TrimSuffix(strings.TrimPrefix(framework.TestContext.Host, "https://"), "/api")) proxyLog := proxyLogs.String() if !strings.Contains(proxyLog, expectedProxyLog) {