From ba0dc3bf5251ca784b8e09ce259b6c48ade0fdf5 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Fri, 5 Mar 2021 16:39:57 -0600 Subject: [PATCH] Remove this test retry loop since the "get kubeconfig" step should now wait. Signed-off-by: Matt Moyer --- test/integration/e2e_test.go | 39 ------------------------------------ 1 file changed, 39 deletions(-) diff --git a/test/integration/e2e_test.go b/test/integration/e2e_test.go index 5973a8a9..a1eecc6a 100644 --- a/test/integration/e2e_test.go +++ b/test/integration/e2e_test.go @@ -6,14 +6,11 @@ import ( "bufio" "bytes" "context" - "crypto/tls" - "crypto/x509" "crypto/x509/pkix" "encoding/base64" "errors" "fmt" "io/ioutil" - "net/http" "net/url" "os" "os/exec" @@ -173,42 +170,6 @@ func TestE2EFullIntegration(t *testing.T) { t.Log("sleeping 10s to wait for JWTAuthenticator to become initialized") time.Sleep(10 * time.Second) - // Verify that we can actually reach the endpoint in the kubeconfig. - require.Eventually(t, func() bool { - kubeconfigCA := x509.NewCertPool() - require.True(t, kubeconfigCA.AppendCertsFromPEM(restConfig.TLSClientConfig.CAData), "expected to load kubeconfig CA") - - // Create an HTTP client that can reach the downstream discovery endpoint using the CA certs. - httpClient := &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{ - MinVersion: tls.VersionTLS12, - RootCAs: kubeconfigCA, - }, - Proxy: func(req *http.Request) (*url.URL, error) { - if env.Proxy == "" { - t.Logf("passing request for %s with no proxy", req.URL) - return nil, nil - } - proxyURL, err := url.Parse(env.Proxy) - require.NoError(t, err) - t.Logf("passing request for %s through proxy %s", req.URL, proxyURL.String()) - return proxyURL, nil - }, - }, - } - req, err := http.NewRequestWithContext(ctx, http.MethodGet, restConfig.Host, nil) - require.NoError(t, err) - resp, err := httpClient.Do(req) - if err != nil { - t.Logf("could not connect to the API server at %q: %v", restConfig.Host, err) - return false - } - t.Logf("got %d response from API server at %q", resp.StatusCode, restConfig.Host) - require.NoError(t, resp.Body.Close()) - return resp.StatusCode < 500 - }, 5*time.Minute, 2*time.Second) - // Run "kubectl get namespaces" which should trigger a browser login via the plugin. start := time.Now() kubectlCmd := exec.CommandContext(ctx, "kubectl", "get", "namespace", "--kubeconfig", kubeconfigPath)