Skip to content

Commit a652104

Browse files
committed
chore: Remove unused dynamicClient
1 parent b1c2e0c commit a652104

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

pkg/util/utils.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2525
"k8s.io/apimachinery/pkg/runtime/schema"
2626
"k8s.io/client-go/discovery"
27-
"k8s.io/client-go/dynamic"
2827
clientset "k8s.io/client-go/kubernetes"
2928
"k8s.io/client-go/rest"
3029
"k8s.io/client-go/tools/clientcmd"
@@ -40,7 +39,6 @@ import (
4039
var config *rest.Config
4140
var currentKubeClient clientset.Interface
4241
var currentDiscoveryClient *discovery.DiscoveryClient
43-
var currentDynamicClient *dynamic.DynamicClient
4442

4543
// CreateKubeClient creates a Kubernetes clientset and a custom resource clientset.
4644
func CreateKubeClient(apiserver string, kubeconfig string) (clientset.Interface, error) {
@@ -120,22 +118,6 @@ func CreateDiscoveryClient(apiserver string, kubeconfig string) (*discovery.Disc
120118
return currentDiscoveryClient, err
121119
}
122120

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-
139121
// GVRFromType returns the GroupVersionResource for a given type.
140122
func GVRFromType(resourceName string, expectedType interface{}) *schema.GroupVersionResource {
141123
if _, ok := expectedType.(*testUnstructuredMock.Foo); ok {

0 commit comments

Comments
 (0)