From 123fb9e2fe09762169edd2028da277aec980e9e5 Mon Sep 17 00:00:00 2001 From: Adam Reese Date: Sat, 10 Sep 2016 23:10:10 -0700 Subject: [PATCH] ref(helm): simplify tunnel tests --- cmd/helm/tunnel.go | 2 +- cmd/helm/tunnel_test.go | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cmd/helm/tunnel.go b/cmd/helm/tunnel.go index 061eb6915..f5be0cfff 100644 --- a/cmd/helm/tunnel.go +++ b/cmd/helm/tunnel.go @@ -68,5 +68,5 @@ func getFirstRunningPod(client unversioned.PodsNamespacer, namespace string, sel return &p, nil } } - return nil, fmt.Errorf("could not find a ready pod") + return nil, fmt.Errorf("could not find a ready tiller pod") } diff --git a/cmd/helm/tunnel_test.go b/cmd/helm/tunnel_test.go index 96608ed4e..511a67a74 100644 --- a/cmd/helm/tunnel_test.go +++ b/cmd/helm/tunnel_test.go @@ -21,7 +21,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/unversioned/testclient" - "k8s.io/kubernetes/pkg/runtime" ) func mockTillerPod() api.Pod { @@ -75,11 +74,7 @@ func TestGetFirstPod(t *testing.T) { } for _, tt := range tests { - client := &testclient.Fake{} - client.PrependReactor("list", "pods", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { - return true, &api.PodList{Items: tt.pods}, nil - }) - + client := testclient.NewSimpleFake(&api.PodList{Items: tt.pods}) name, err := getTillerPodName(client, api.NamespaceDefault) if (err != nil) != tt.err { t.Errorf("%q. expected error: %v, got %v", tt.name, tt.err, err)