From 684e17ef901e336de70c201fdb94fb55543c2637 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sat, 22 Jul 2017 14:53:26 -0400 Subject: [PATCH] Use a client interface instead of a concrete type Aids testing Kubernetes-commit: b9bebe8a4e12648a68ed02036ff8d4a7ec9be2eb --- tools/leaderelection/resourcelock/BUILD | 1 - tools/leaderelection/resourcelock/interface.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/leaderelection/resourcelock/BUILD b/tools/leaderelection/resourcelock/BUILD index d8196354..48570fe8 100644 --- a/tools/leaderelection/resourcelock/BUILD +++ b/tools/leaderelection/resourcelock/BUILD @@ -18,7 +18,6 @@ go_library( deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", - "//vendor/k8s.io/client-go/kubernetes:go_default_library", "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library", ], diff --git a/tools/leaderelection/resourcelock/interface.go b/tools/leaderelection/resourcelock/interface.go index a6ea6917..676fd1d7 100644 --- a/tools/leaderelection/resourcelock/interface.go +++ b/tools/leaderelection/resourcelock/interface.go @@ -20,7 +20,7 @@ import ( "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - cs "k8s.io/client-go/kubernetes" + corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/record" ) @@ -76,7 +76,7 @@ type Interface interface { } // Manufacture will create a lock of a given type according to the input parameters -func New(lockType string, ns string, name string, client *cs.Clientset, rlc ResourceLockConfig) (Interface, error) { +func New(lockType string, ns string, name string, client corev1.CoreV1Interface, rlc ResourceLockConfig) (Interface, error) { switch lockType { case EndpointsResourceLock: return &EndpointsLock{