File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package framework
18
18
19
19
import (
20
20
apiruntime "k8s.io/apimachinery/pkg/runtime"
21
+ "k8s.io/client-go/dynamic"
21
22
"k8s.io/client-go/kubernetes"
22
23
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
23
24
virtv1 "kubevirt.io/api/core/v1"
@@ -43,6 +44,7 @@ type Clients struct {
43
44
kubectl kubectl.Kubectl
44
45
d8virtualization d8.D8Virtualization
45
46
client client.Client
47
+ dynamic dynamic.Interface
46
48
}
47
49
48
50
func (c Clients ) VirtClient () kubeclient.Client {
@@ -57,6 +59,10 @@ func (c Clients) GenericClient() client.Client {
57
59
return c .client
58
60
}
59
61
62
+ func (c Clients ) DynamicClient () dynamic.Interface {
63
+ return c .dynamic
64
+ }
65
+
60
66
func (c Clients ) Kubectl () kubectl.Kubectl {
61
67
return c .kubectl
62
68
}
@@ -82,6 +88,10 @@ func init() {
82
88
if err != nil {
83
89
panic (err )
84
90
}
91
+ clients .dynamic , err = dynamic .NewForConfig (restConfig )
92
+ if err != nil {
93
+ panic (err )
94
+ }
85
95
clients .kubectl , err = kubectl .NewKubectl (kubectl .KubectlConf (conf .ClusterTransport ))
86
96
if err != nil {
87
97
panic (err )
Original file line number Diff line number Diff line change @@ -29,14 +29,9 @@ import (
29
29
. "github.com/onsi/gomega"
30
30
"golang.org/x/sync/errgroup"
31
31
corev1 "k8s.io/api/core/v1"
32
- storagev1 "k8s.io/api/storage/v1"
33
32
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
34
- "k8s.io/apimachinery/pkg/runtime"
35
- "k8s.io/cli-runtime/pkg/genericclioptions"
36
33
"k8s.io/client-go/dynamic"
37
34
"k8s.io/client-go/kubernetes"
38
- clientgoscheme "k8s.io/client-go/kubernetes/scheme"
39
- "k8s.io/client-go/rest"
40
35
"sigs.k8s.io/controller-runtime/pkg/client"
41
36
42
37
"github.com/deckhouse/virtualization/api/client/kubeclient"
@@ -111,9 +106,7 @@ func init() {
111
106
virtClient = clients .VirtClient ()
112
107
kubeClient = clients .KubeClient ()
113
108
crClient = clients .GenericClient ()
114
- if dynamicClient , err = dynamic .NewForConfig (restConfig ); err != nil {
115
- log .Fatal (err )
116
- }
109
+ dynamicClient = clients .DynamicClient ()
117
110
118
111
if git , err = gt .NewGit (); err != nil {
119
112
log .Fatal (err )
You can’t perform that action at this time.
0 commit comments