Skip to content

Commit 0b5d6fc

Browse files
committed
kc_test: Update tests to include extra get for MC
1 parent 3faabfb commit 0b5d6fc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

pkg/controller/kubelet-config/kubelet_config_controller_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ func TestKubeletConfigCreate(t *testing.T) {
464464
f.expectUpdateKubeletConfigRoot(kc1)
465465
f.expectCreateMachineConfigAction(mcs)
466466
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
467+
f.expectGetMachineConfigAction(mcs)
467468
f.expectUpdateKubeletConfig(kc1)
468469

469470
f.run(getKey(kc1, t))
@@ -510,6 +511,7 @@ func TestKubeletConfigMultiCreate(t *testing.T) {
510511
f.expectUpdateKubeletConfigRoot(kc)
511512
f.expectCreateMachineConfigAction(mcs)
512513
f.expectPatchKubeletConfig(kc, []byte(expectedPatch))
514+
f.expectGetMachineConfigAction(mcs)
513515
f.expectUpdateKubeletConfig(kc)
514516
f.run(poolName)
515517
}
@@ -558,6 +560,7 @@ func TestKubeletConfigAutoSizingReserved(t *testing.T) {
558560
f.expectUpdateKubeletConfigRoot(kc1)
559561
f.expectCreateMachineConfigAction(mcs)
560562
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
563+
f.expectGetMachineConfigAction(mcs)
561564
f.expectUpdateKubeletConfig(kc1)
562565

563566
f.run(getKey(kc1, t))
@@ -601,6 +604,7 @@ func TestKubeletConfiglogFile(t *testing.T) {
601604
f.expectUpdateKubeletConfigRoot(kc1)
602605
f.expectCreateMachineConfigAction(mcs)
603606
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
607+
f.expectGetMachineConfigAction(mcs)
604608
f.expectUpdateKubeletConfig(kc1)
605609

606610
f.run(getKey(kc1, t))
@@ -638,6 +642,7 @@ func TestKubeletConfigUpdates(t *testing.T) {
638642
f.expectUpdateKubeletConfigRoot(kc1)
639643
f.expectCreateMachineConfigAction(mcs)
640644
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
645+
f.expectGetMachineConfigAction(mcs)
641646
f.expectUpdateKubeletConfig(kc1)
642647

643648
c := f.newController(fgHandler)
@@ -696,6 +701,7 @@ func TestKubeletConfigUpdates(t *testing.T) {
696701
f.expectGetMachineConfigAction(mcs)
697702
f.expectUpdateMachineConfigAction(mcUpdate)
698703
f.expectPatchKubeletConfig(kcUpdate, kcfgPatchBytes)
704+
f.expectGetMachineConfigAction(mcs)
699705
f.expectUpdateKubeletConfig(kcUpdate)
700706

701707
f.validateActions()
@@ -742,6 +748,7 @@ func TestMachineConfigUpdateUponFeatureGateUpdate(t *testing.T) {
742748
f.expectUpdateKubeletConfigRoot(kc1)
743749
f.expectCreateMachineConfigAction(mcs)
744750
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
751+
f.expectGetMachineConfigAction(mcs)
745752
f.expectUpdateKubeletConfig(kc1)
746753

747754
c := f.newController(fgHandler)
@@ -787,6 +794,7 @@ func TestMachineConfigUpdateUponFeatureGateUpdate(t *testing.T) {
787794
f.expectGetMachineConfigAction(mcs)
788795
f.expectUpdateMachineConfigAction(mcUpdate)
789796
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
797+
f.expectGetMachineConfigAction(mcs)
790798
f.expectUpdateKubeletConfig(kc1)
791799

792800
f.validateActions()
@@ -834,6 +842,7 @@ func TestMachineConfigSkipUpdate(t *testing.T) {
834842
f.expectUpdateKubeletConfigRoot(kc1)
835843
f.expectCreateMachineConfigAction(mcs)
836844
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
845+
f.expectGetMachineConfigAction(mcs)
837846
f.expectUpdateKubeletConfig(kc1)
838847

839848
c := f.newController(fgHandler)
@@ -981,6 +990,7 @@ func TestKubeletFeatureExists(t *testing.T) {
981990
f.expectUpdateKubeletConfigRoot(kc1)
982991
f.expectCreateMachineConfigAction(mcs)
983992
f.expectPatchKubeletConfig(kc1, kcfgPatchBytes)
993+
f.expectGetMachineConfigAction(mcs)
984994
f.expectUpdateKubeletConfig(kc1)
985995

986996
f.run(getKey(kc1, t))
@@ -1200,6 +1210,7 @@ func TestAddAnnotationExistingKubeletConfig(t *testing.T) {
12001210
f.expectUpdateKubeletConfigRoot(kc)
12011211
f.expectUpdateMachineConfigAction(kcMC)
12021212
f.expectPatchKubeletConfig(kc, []byte("{}"))
1213+
f.expectGetMachineConfigAction(kcMC)
12031214
f.expectUpdateKubeletConfig(kc)
12041215

12051216
c := f.newController(fgHandler)

pkg/controller/kubelet-config/kubelet_config_features_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ func TestFeaturesDefault(t *testing.T) {
9797
f.expectGetMachineConfigAction(mcs2Deprecated)
9898
f.expectGetMachineConfigAction(mcs2)
9999
f.expectCreateMachineConfigAction(mcs2)
100+
f.expectGetMachineConfigAction(mcs2Deprecated)
101+
f.expectGetMachineConfigAction(mcs2)
100102

101103
f.runFeature(getKeyFromFeatureGate(features, t), fgHandler)
102104
})
@@ -153,6 +155,8 @@ func TestFeaturesCustomNoUpgrade(t *testing.T) {
153155
f.expectGetMachineConfigAction(mcs2Deprecated)
154156
f.expectGetMachineConfigAction(mcs2)
155157
f.expectCreateMachineConfigAction(mcs2)
158+
f.expectGetMachineConfigAction(mcs2Deprecated)
159+
f.expectGetMachineConfigAction(mcs2)
156160
f.runFeature(getKeyFromFeatureGate(features, t), fgHandler)
157161
})
158162
}

0 commit comments

Comments
 (0)