Skip to content

Commit 5883b7d

Browse files
committed
switch from fake.NewSimpleClientset to fake.NewClientset
1 parent 52dbb71 commit 5883b7d

File tree

5 files changed

+52
-52
lines changed

5 files changed

+52
-52
lines changed

cloud/linode/loadbalancers_test.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func testCreateNodeBalancerWithNodeNoAddresses(t *testing.T, client *linodego.Cl
504504
if !assertion {
505505
t.Error("type assertion failed")
506506
}
507-
fakeClientset := fake.NewSimpleClientset()
507+
fakeClientset := fake.NewClientset()
508508
lb.kubeClient = fakeClientset
509509

510510
defer func() {
@@ -736,7 +736,7 @@ func testUpdateNodeBalancerWithVPCBackend(t *testing.T, client *linodego.Client,
736736
if !assertion {
737737
t.Error("type assertion failed")
738738
}
739-
fakeClientset := fake.NewSimpleClientset()
739+
fakeClientset := fake.NewClientset()
740740
lb.kubeClient = fakeClientset
741741

742742
defer func() {
@@ -823,7 +823,7 @@ func testCreateNodeBalancerWithVPCOnlySubnetFlag(t *testing.T, client *linodego.
823823
if !assertion {
824824
t.Error("type assertion failed")
825825
}
826-
fakeClientset := fake.NewSimpleClientset()
826+
fakeClientset := fake.NewClientset()
827827
lb.kubeClient = fakeClientset
828828

829829
defer func() {
@@ -916,7 +916,7 @@ func testCreateNodeBalancerWithVPCNoFlagOrAnnotation(t *testing.T, client *linod
916916
if !assertion {
917917
t.Error("type assertion failed")
918918
}
919-
fakeClientset := fake.NewSimpleClientset()
919+
fakeClientset := fake.NewClientset()
920920
lb.kubeClient = fakeClientset
921921

922922
defer func() {
@@ -1005,7 +1005,7 @@ func testCreateNodeBalancerWithVPCAnnotationOnly(t *testing.T, client *linodego.
10051005
if !assertion {
10061006
t.Error("type assertion failed")
10071007
}
1008-
fakeClientset := fake.NewSimpleClientset()
1008+
fakeClientset := fake.NewClientset()
10091009
lb.kubeClient = fakeClientset
10101010

10111011
defer func() {
@@ -1090,7 +1090,7 @@ func testCreateNodeBalancerWithVPCOnlySubnetIDFlag(t *testing.T, client *linodeg
10901090
if !assertion {
10911091
t.Error("type assertion failed")
10921092
}
1093-
fakeClientset := fake.NewSimpleClientset()
1093+
fakeClientset := fake.NewClientset()
10941094
lb.kubeClient = fakeClientset
10951095

10961096
defer func() {
@@ -1236,7 +1236,7 @@ func testUpdateLoadBalancerAddNode(t *testing.T, client *linodego.Client, f *fak
12361236
if !assertion {
12371237
t.Error("type assertion failed")
12381238
}
1239-
fakeClientset := fake.NewSimpleClientset()
1239+
fakeClientset := fake.NewClientset()
12401240
lb.kubeClient = fakeClientset
12411241

12421242
defer func() {
@@ -1401,7 +1401,7 @@ func testUpdateLoadBalancerAddAnnotation(t *testing.T, client *linodego.Client,
14011401
if !assertion {
14021402
t.Error("type assertion failed")
14031403
}
1404-
fakeClientset := fake.NewSimpleClientset()
1404+
fakeClientset := fake.NewClientset()
14051405
lb.kubeClient = fakeClientset
14061406

14071407
defer func() {
@@ -1476,7 +1476,7 @@ func testUpdateLoadBalancerAddPortAnnotation(t *testing.T, client *linodego.Clie
14761476
if !assertion {
14771477
t.Error("type assertion failed")
14781478
}
1479-
fakeClientset := fake.NewSimpleClientset()
1479+
fakeClientset := fake.NewClientset()
14801480
lb.kubeClient = fakeClientset
14811481

14821482
defer func() {
@@ -1589,7 +1589,7 @@ func testVeryLongServiceName(t *testing.T, client *linodego.Client, _ *fakeAPI)
15891589
if !assertion {
15901590
t.Error("type assertion failed")
15911591
}
1592-
fakeClientset := fake.NewSimpleClientset()
1592+
fakeClientset := fake.NewClientset()
15931593
lb.kubeClient = fakeClientset
15941594

15951595
defer func() {
@@ -1657,7 +1657,7 @@ func testUpdateLoadBalancerAddTags(t *testing.T, client *linodego.Client, _ *fak
16571657
if !assertion {
16581658
t.Error("type assertion failed")
16591659
}
1660-
fakeClientset := fake.NewSimpleClientset()
1660+
fakeClientset := fake.NewClientset()
16611661
lb.kubeClient = fakeClientset
16621662
clusterName := "linodelb"
16631663

@@ -1747,7 +1747,7 @@ func testUpdateLoadBalancerAddTLSPort(t *testing.T, client *linodego.Client, _ *
17471747
_ = lb.EnsureLoadBalancerDeleted(t.Context(), "linodelb", svc)
17481748
}()
17491749

1750-
fakeClientset := fake.NewSimpleClientset()
1750+
fakeClientset := fake.NewClientset()
17511751
lb.kubeClient = fakeClientset
17521752
addTLSSecret(t, lb.kubeClient)
17531753

@@ -1823,7 +1823,7 @@ func testUpdateLoadBalancerAddProxyProtocol(t *testing.T, client *linodego.Clien
18231823
if !assertion {
18241824
t.Error("type assertion failed")
18251825
}
1826-
fakeClientset := fake.NewSimpleClientset()
1826+
fakeClientset := fake.NewClientset()
18271827
lb.kubeClient = fakeClientset
18281828

18291829
for _, tc := range []struct {
@@ -1951,7 +1951,7 @@ func testUpdateLoadBalancerAddNewFirewall(t *testing.T, client *linodego.Client,
19511951
if !assertion {
19521952
t.Error("type assertion failed")
19531953
}
1954-
fakeClientset := fake.NewSimpleClientset()
1954+
fakeClientset := fake.NewClientset()
19551955
lb.kubeClient = fakeClientset
19561956

19571957
defer func() {
@@ -2052,7 +2052,7 @@ func testUpdateLoadBalancerAddNewFirewallACL(t *testing.T, client *linodego.Clie
20522052
if !assertion {
20532053
t.Error("type assertion failed")
20542054
}
2055-
fakeClientset := fake.NewSimpleClientset()
2055+
fakeClientset := fake.NewClientset()
20562056
lb.kubeClient = fakeClientset
20572057

20582058
defer func() {
@@ -2184,7 +2184,7 @@ func testUpdateLoadBalancerDeleteFirewallRemoveACL(t *testing.T, client *linodeg
21842184
if !assertion {
21852185
t.Error("type assertion failed")
21862186
}
2187-
fakeClientset := fake.NewSimpleClientset()
2187+
fakeClientset := fake.NewClientset()
21882188
lb.kubeClient = fakeClientset
21892189

21902190
svc.SetAnnotations(map[string]string{
@@ -2283,7 +2283,7 @@ func testUpdateLoadBalancerUpdateFirewallRemoveACLaddID(t *testing.T, client *li
22832283
if !assertion {
22842284
t.Error("type assertion failed")
22852285
}
2286-
fakeClientset := fake.NewSimpleClientset()
2286+
fakeClientset := fake.NewClientset()
22872287
lb.kubeClient = fakeClientset
22882288

22892289
svc.SetAnnotations(map[string]string{
@@ -2423,7 +2423,7 @@ func testUpdateLoadBalancerUpdateFirewallRemoveIDaddACL(t *testing.T, client *li
24232423
if !assertion {
24242424
t.Error("type assertion failed")
24252425
}
2426-
fakeClientset := fake.NewSimpleClientset()
2426+
fakeClientset := fake.NewClientset()
24272427
lb.kubeClient = fakeClientset
24282428

24292429
fwClient := services.LinodeClient{Client: client}
@@ -2570,7 +2570,7 @@ func testUpdateLoadBalancerUpdateFirewallACL(t *testing.T, client *linodego.Clie
25702570
if !assertion {
25712571
t.Error("type assertion failed")
25722572
}
2573-
fakeClientset := fake.NewSimpleClientset()
2573+
fakeClientset := fake.NewClientset()
25742574
lb.kubeClient = fakeClientset
25752575

25762576
defer func() {
@@ -2806,7 +2806,7 @@ func testUpdateLoadBalancerUpdateFirewall(t *testing.T, client *linodego.Client,
28062806
if !assertion {
28072807
t.Error("type assertion failed")
28082808
}
2809-
fakeClientset := fake.NewSimpleClientset()
2809+
fakeClientset := fake.NewClientset()
28102810
lb.kubeClient = fakeClientset
28112811

28122812
defer func() {
@@ -2939,7 +2939,7 @@ func testUpdateLoadBalancerDeleteFirewallRemoveID(t *testing.T, client *linodego
29392939
if !assertion {
29402940
t.Error("type assertion failed")
29412941
}
2942-
fakeClientset := fake.NewSimpleClientset()
2942+
fakeClientset := fake.NewClientset()
29432943
lb.kubeClient = fakeClientset
29442944

29452945
defer func() {
@@ -3046,7 +3046,7 @@ func testUpdateLoadBalancerAddReservedIP(t *testing.T, client *linodego.Client,
30463046
_ = lb.EnsureLoadBalancerDeleted(t.Context(), clusterName, svc)
30473047
}()
30483048

3049-
fakeClientset := fake.NewSimpleClientset()
3049+
fakeClientset := fake.NewClientset()
30503050
lb.kubeClient = fakeClientset
30513051

30523052
nodeBalancer, err := client.CreateNodeBalancer(t.Context(), linodego.NodeBalancerCreateOptions{
@@ -3131,7 +3131,7 @@ func testUpdateLoadBalancerAddNodeBalancerID(t *testing.T, client *linodego.Clie
31313131
_ = lb.EnsureLoadBalancerDeleted(t.Context(), "linodelb", svc)
31323132
}()
31333133

3134-
fakeClientset := fake.NewSimpleClientset()
3134+
fakeClientset := fake.NewClientset()
31353135
lb.kubeClient = fakeClientset
31363136

31373137
nodeBalancer, err := client.CreateNodeBalancer(t.Context(), linodego.NodeBalancerCreateOptions{
@@ -4319,7 +4319,7 @@ func testEnsureExistingLoadBalancer(t *testing.T, client *linodego.Client, _ *fa
43194319
if !assertion {
43204320
t.Error("type assertion failed")
43214321
}
4322-
lb.kubeClient = fake.NewSimpleClientset()
4322+
lb.kubeClient = fake.NewClientset()
43234323
addTLSSecret(t, lb.kubeClient)
43244324

43254325
configs := []*linodego.NodeBalancerConfigCreateOptions{}
@@ -4652,7 +4652,7 @@ func testUpdateLoadBalancerNoNodes(t *testing.T, client *linodego.Client, _ *fak
46524652
_ = lb.EnsureLoadBalancerDeleted(t.Context(), "linodelb", svc)
46534653
}()
46544654

4655-
fakeClientset := fake.NewSimpleClientset()
4655+
fakeClientset := fake.NewClientset()
46564656
lb.kubeClient = fakeClientset
46574657

46584658
nodeBalancer, err := client.CreateNodeBalancer(t.Context(), linodego.NodeBalancerCreateOptions{
@@ -4686,7 +4686,7 @@ func testGetNodeBalancerByStatus(t *testing.T, client *linodego.Client, _ *fakeA
46864686
if !assertion {
46874687
t.Error("type assertion failed")
46884688
}
4689-
fakeClientset := fake.NewSimpleClientset()
4689+
fakeClientset := fake.NewClientset()
46904690
lb.kubeClient = fakeClientset
46914691

46924692
for _, test := range []struct {
@@ -4894,7 +4894,7 @@ func testEnsureNewLoadBalancer(t *testing.T, client *linodego.Client, _ *fakeAPI
48944894
if !assertion {
48954895
t.Error("type assertion failed")
48964896
}
4897-
lb.kubeClient = fake.NewSimpleClientset()
4897+
lb.kubeClient = fake.NewClientset()
48984898
addTLSSecret(t, lb.kubeClient)
48994899

49004900
defer func() { _ = lb.EnsureLoadBalancerDeleted(t.Context(), "linodelb", svc) }()
@@ -4975,7 +4975,7 @@ func testGetLoadBalancer(t *testing.T, client *linodego.Client, _ *fakeAPI) {
49754975
if err != nil {
49764976
t.Fatal(err)
49774977
}
4978-
fakeClientset := fake.NewSimpleClientset()
4978+
fakeClientset := fake.NewClientset()
49794979
lb.kubeClient = fakeClientset
49804980

49814981
defer func() { _ = lb.EnsureLoadBalancerDeleted(t.Context(), "linodelb", svc) }()
@@ -5112,7 +5112,7 @@ func Test_getPortConfigAnnotation(t *testing.T) {
51125112
}
51135113

51145114
func Test_getTLSCertInfo(t *testing.T) {
5115-
kubeClient := fake.NewSimpleClientset()
5115+
kubeClient := fake.NewClientset()
51165116
addTLSSecret(t, kubeClient)
51175117

51185118
testcases := []struct {

cloud/linode/node_controller_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestNodeController_Run(t *testing.T) {
2727
ctrl := gomock.NewController(t)
2828
defer ctrl.Finish()
2929
client := mocks.NewMockClient(ctrl)
30-
kubeClient := fake.NewSimpleClientset()
30+
kubeClient := fake.NewClientset()
3131
informer := informers.NewSharedInformerFactory(kubeClient, 0).Core().V1().Nodes()
3232
mockQueue := workqueue.NewTypedDelayingQueueWithConfig(workqueue.TypedDelayingQueueConfig[nodeRequest]{Name: "test"})
3333

@@ -68,7 +68,7 @@ func TestNodeController_processNext(t *testing.T) {
6868
ctrl := gomock.NewController(t)
6969
defer ctrl.Finish()
7070
client := mocks.NewMockClient(ctrl)
71-
kubeClient := fake.NewSimpleClientset()
71+
kubeClient := fake.NewClientset()
7272
queue := workqueue.NewTypedDelayingQueueWithConfig(workqueue.TypedDelayingQueueConfig[nodeRequest]{Name: "testQueue"})
7373
node := &v1.Node{
7474
ObjectMeta: metav1.ObjectMeta{
@@ -155,7 +155,7 @@ func TestNodeController_processNext(t *testing.T) {
155155

156156
t.Run("should return no error if node in k8s doesn't exist", func(t *testing.T) {
157157
controller.addNodeToQueue(node)
158-
controller.kubeclient = fake.NewSimpleClientset()
158+
controller.kubeclient = fake.NewClientset()
159159
defer func() { controller.kubeclient = kubeClient }()
160160
result := controller.processNext()
161161
assert.True(t, result, "processNext should return true")
@@ -202,7 +202,7 @@ func TestNodeController_handleNode(t *testing.T) {
202202
ctrl := gomock.NewController(t)
203203
defer ctrl.Finish()
204204
client := mocks.NewMockClient(ctrl)
205-
kubeClient := fake.NewSimpleClientset()
205+
kubeClient := fake.NewClientset()
206206
node := &v1.Node{
207207
ObjectMeta: metav1.ObjectMeta{
208208
Name: "test-node",

cloud/linode/nodeipamcontroller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func Test_startNodeIpamController(t *testing.T) {
134134
allocateNodeCIDRs bool
135135
clusterCIDR string
136136
}
137-
kubeClient := fake.NewSimpleClientset()
137+
kubeClient := fake.NewClientset()
138138
tests := []struct {
139139
name string
140140
args args

cloud/linode/service_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func Test_serviceController_Run(t *testing.T) {
2121
ctrl := gomock.NewController(t)
2222
defer ctrl.Finish()
2323
client := mocks.NewMockClient(ctrl)
24-
kubeClient := fake.NewSimpleClientset()
24+
kubeClient := fake.NewClientset()
2525
informer := informers.NewSharedInformerFactory(kubeClient, 0).Core().V1().Services()
2626
mockQueue := workqueue.NewTypedDelayingQueueWithConfig(workqueue.TypedDelayingQueueConfig[any]{Name: "test"})
2727

0 commit comments

Comments
 (0)