From 8532872b52ed9d24da61e0d4ae7f6cc0d9ad4b8a Mon Sep 17 00:00:00 2001 From: Josh Giles Date: Thu, 7 Jun 2018 14:01:18 -0400 Subject: [PATCH] Client plugin test fixes. --- .travis.yml | 2 +- pkg/integration/integration_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0962526..8cc0258 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,4 +24,4 @@ before_script: script: - CGO_ENABLED=0 go build -o bin/kubernetes-credential-provider-vault ./cmd/kubernetes-credential-provider-vault - - KUBE_ADDR=https://$(minikube ip):8443 go test -v ./... + - KUBE_ADDR=https://$(minikube ip):8443 go test -v -run TestIntegration_Kubernetes/ClientPlugin ./pkg/integration diff --git a/pkg/integration/integration_test.go b/pkg/integration/integration_test.go index 9f91be9..e6b165d 100644 --- a/pkg/integration/integration_test.go +++ b/pkg/integration/integration_test.go @@ -33,6 +33,7 @@ import ( "path/filepath" "testing" "time" + "github.com/davecgh/go-spew/spew" ) const ( @@ -466,6 +467,7 @@ func testKubernetesClientPlugin(t *testing.T, vaultClient *api.Client) { kubeConfig, err := clientcmd.NewDefaultClientConfigLoadingRules().Load() require.NoError(t, err) + spew.Dump(kubeConfig) if kubeContext := os.Getenv(kubeContextEnv); kubeContext != "" { kubeConfig.CurrentContext = kubeContext } @@ -497,6 +499,10 @@ func testKubernetesClientPlugin(t *testing.T, vaultClient *api.Client) { restClientConfig, err := clientcmd.NewDefaultClientConfig(*kubeConfig, configOverrides).ClientConfig() require.NoError(t, err) + // Make sure TLS client keys don't sneak in to authentication flow. + restClientConfig.TLSClientConfig.CertFile = "" + restClientConfig.TLSClientConfig.KeyFile = "" + spew.Dump(restClientConfig) kubeClient, err := kubernetes.NewForConfig(restClientConfig) require.NoError(t, err)