@@ -24,7 +24,6 @@ import (
24
24
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
25
25
"k8s.io/apimachinery/pkg/runtime/schema"
26
26
"k8s.io/client-go/discovery"
27
- "k8s.io/client-go/dynamic"
28
27
clientset "k8s.io/client-go/kubernetes"
29
28
"k8s.io/client-go/rest"
30
29
"k8s.io/client-go/tools/clientcmd"
@@ -40,7 +39,6 @@ import (
40
39
var config * rest.Config
41
40
var currentKubeClient clientset.Interface
42
41
var currentDiscoveryClient * discovery.DiscoveryClient
43
- var currentDynamicClient * dynamic.DynamicClient
44
42
45
43
// CreateKubeClient creates a Kubernetes clientset and a custom resource clientset.
46
44
func CreateKubeClient (apiserver string , kubeconfig string ) (clientset.Interface , error ) {
@@ -120,22 +118,6 @@ func CreateDiscoveryClient(apiserver string, kubeconfig string) (*discovery.Disc
120
118
return currentDiscoveryClient , err
121
119
}
122
120
123
- // CreateDynamicClient creates a Kubernetes dynamic client.
124
- func CreateDynamicClient (apiserver string , kubeconfig string ) (* dynamic.DynamicClient , error ) {
125
- if currentDynamicClient != nil {
126
- return currentDynamicClient , nil
127
- }
128
- var err error
129
- if config == nil {
130
- config , err = clientcmd .BuildConfigFromFlags (apiserver , kubeconfig )
131
- if err != nil {
132
- return nil , err
133
- }
134
- }
135
- currentDynamicClient , err = dynamic .NewForConfig (config )
136
- return currentDynamicClient , err
137
- }
138
-
139
121
// GVRFromType returns the GroupVersionResource for a given type.
140
122
func GVRFromType (resourceName string , expectedType interface {}) * schema.GroupVersionResource {
141
123
if _ , ok := expectedType .(* testUnstructuredMock.Foo ); ok {
0 commit comments