mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-31 06:34:50 +00:00
Use a client interface instead of a concrete type
Aids testing Kubernetes-commit: b9bebe8a4e12648a68ed02036ff8d4a7ec9be2eb
This commit is contained in:
committed by
Kubernetes Publisher
parent
27faac48eb
commit
684e17ef90
@@ -18,7 +18,6 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/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/kubernetes/typed/core/v1:go_default_library",
|
||||||
"//vendor/k8s.io/client-go/tools/record:go_default_library",
|
"//vendor/k8s.io/client-go/tools/record:go_default_library",
|
||||||
],
|
],
|
||||||
|
@@ -20,7 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
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"
|
"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
|
// 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 {
|
switch lockType {
|
||||||
case EndpointsResourceLock:
|
case EndpointsResourceLock:
|
||||||
return &EndpointsLock{
|
return &EndpointsLock{
|
||||||
|
Reference in New Issue
Block a user