From 93abdb120597bd36b19139851f3d62ef355e0138 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Larsen Date: Thu, 17 Jan 2019 21:53:32 +0100 Subject: [PATCH] Fix websocket e2e tests for https endpoints When running e2e conformance tests against a public https protected APIserver the websocket tests would fail because it fell back to using `ws://` instead of `wss://` for the websocket connection. This happened because the code detect if HTTPS is used only looks for HTTPS related configuration in the kubeconfig, like a custom CA or certificates. The fix is to always use HTTPS when the apiserver URL has the scheme `https://`. Signed-off-by: Mikkel Oscar Lyderik Larsen --- test/e2e/framework/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 7256ab61eb..fa97b132aa 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -4226,7 +4226,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st if err != nil { return nil, fmt.Errorf("Failed to create tls config: %v", err) } - if tlsConfig != nil { + if tlsConfig != nil || url.Scheme == "https" { url.Scheme = "wss" if !strings.Contains(url.Host, ":") { url.Host += ":443"