@@ -80,7 +80,7 @@ func TestKubeadmConfigReconciler_MachineToBootstrapMapFuncReturn(t *testing.T) {
80
80
}
81
81
for i := 0 ; i < 3 ; i ++ {
82
82
o := machineObjs [i ]
83
- configs := reconciler .MachineToBootstrapMapFunc (o )
83
+ configs := reconciler .MachineToBootstrapMapFunc (ctx , o )
84
84
if i == 1 {
85
85
g .Expect (configs [0 ].Name ).To (Equal (expectedConfigName ))
86
86
} else {
@@ -158,7 +158,7 @@ func TestKubeadmConfigReconciler_TestSecretOwnerReferenceReconciliation(t *testi
158
158
secret ,
159
159
cluster ,
160
160
}
161
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
161
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
162
162
163
163
k := & KubeadmConfigReconciler {
164
164
Client : myclient ,
@@ -272,7 +272,7 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnEarlyIfMachineHasDataSecretName
272
272
machine ,
273
273
config ,
274
274
}
275
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
275
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
276
276
277
277
k := & KubeadmConfigReconciler {
278
278
Client : myclient ,
@@ -315,7 +315,7 @@ func TestKubeadmConfigReconciler_ReturnEarlyIfClusterInfraNotReady(t *testing.T)
315
315
machine ,
316
316
config ,
317
317
}
318
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
318
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
319
319
320
320
k := & KubeadmConfigReconciler {
321
321
Client : myclient ,
@@ -450,7 +450,7 @@ func TestKubeadmConfigReconciler_Reconcile_RequeueJoiningNodesIfControlPlaneNotI
450
450
t .Run (tc .name , func (t * testing.T ) {
451
451
g := NewWithT (t )
452
452
453
- myclient := fake .NewClientBuilder ().WithObjects (tc .objects ... ).Build ()
453
+ myclient := fake .NewClientBuilder ().WithObjects (tc .objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
454
454
455
455
k := & KubeadmConfigReconciler {
456
456
Client : myclient ,
@@ -492,7 +492,7 @@ func TestKubeadmConfigReconciler_Reconcile_GenerateCloudConfigData(t *testing.T)
492
492
}
493
493
objects = append (objects , createSecrets (t , cluster , controlPlaneInitConfig )... )
494
494
495
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
495
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
496
496
497
497
k := & KubeadmConfigReconciler {
498
498
Client : myclient ,
@@ -553,7 +553,7 @@ func TestKubeadmConfigReconciler_Reconcile_ErrorIfJoiningControlPlaneHasInvalidC
553
553
controlPlaneJoinConfig ,
554
554
}
555
555
objects = append (objects , createSecrets (t , cluster , controlPlaneInitConfig )... )
556
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
556
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
557
557
558
558
k := & KubeadmConfigReconciler {
559
559
Client : myclient ,
@@ -597,7 +597,7 @@ func TestKubeadmConfigReconciler_Reconcile_RequeueIfControlPlaneIsMissingAPIEndp
597
597
}
598
598
objects = append (objects , createSecrets (t , cluster , controlPlaneInitConfig )... )
599
599
600
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
600
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
601
601
602
602
k := & KubeadmConfigReconciler {
603
603
Client : myclient ,
@@ -675,7 +675,7 @@ func TestReconcileIfJoinCertificatesAvailableConditioninNodesAndControlPlaneIsRe
675
675
config ,
676
676
}
677
677
objects = append (objects , createSecrets (t , cluster , config )... )
678
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
678
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
679
679
k := & KubeadmConfigReconciler {
680
680
Client : myclient ,
681
681
KubeadmInitLock : & myInitLocker {},
@@ -752,7 +752,7 @@ func TestReconcileIfJoinNodePoolsAndControlPlaneIsReady(t *testing.T) {
752
752
config ,
753
753
}
754
754
objects = append (objects , createSecrets (t , cluster , config )... )
755
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
755
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
756
756
k := & KubeadmConfigReconciler {
757
757
Client : myclient ,
758
758
KubeadmInitLock : & myInitLocker {},
@@ -851,7 +851,7 @@ func TestBootstrapDataFormat(t *testing.T) {
851
851
}
852
852
objects = append (objects , createSecrets (t , cluster , config )... )
853
853
854
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
854
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
855
855
856
856
k := & KubeadmConfigReconciler {
857
857
Client : myclient ,
@@ -932,7 +932,7 @@ func TestKubeadmConfigSecretCreatedStatusNotPatched(t *testing.T) {
932
932
}
933
933
934
934
objects = append (objects , createSecrets (t , cluster , initConfig )... )
935
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
935
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
936
936
k := & KubeadmConfigReconciler {
937
937
Client : myclient ,
938
938
KubeadmInitLock : & myInitLocker {},
@@ -1009,7 +1009,7 @@ func TestBootstrapTokenTTLExtension(t *testing.T) {
1009
1009
}
1010
1010
1011
1011
objects = append (objects , createSecrets (t , cluster , initConfig )... )
1012
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
1012
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}, & clusterv1. Machine {}). Build ()
1013
1013
k := & KubeadmConfigReconciler {
1014
1014
Client : myclient ,
1015
1015
KubeadmInitLock : & myInitLocker {},
@@ -1210,7 +1210,7 @@ func TestBootstrapTokenRotationMachinePool(t *testing.T) {
1210
1210
}
1211
1211
1212
1212
objects = append (objects , createSecrets (t , cluster , initConfig )... )
1213
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
1213
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}, & expv1. MachinePool {}). Build ()
1214
1214
k := & KubeadmConfigReconciler {
1215
1215
Client : myclient ,
1216
1216
KubeadmInitLock : & myInitLocker {},
@@ -1766,7 +1766,7 @@ func TestKubeadmConfigReconciler_ClusterToKubeadmConfigs(t *testing.T) {
1766
1766
reconciler := & KubeadmConfigReconciler {
1767
1767
Client : fakeClient ,
1768
1768
}
1769
- configs := reconciler .ClusterToKubeadmConfigs (cluster )
1769
+ configs := reconciler .ClusterToKubeadmConfigs (ctx , cluster )
1770
1770
names := make ([]string , 6 )
1771
1771
for i := range configs {
1772
1772
names [i ] = configs [i ].Name
@@ -1835,7 +1835,7 @@ func TestKubeadmConfigReconciler_Reconcile_ExactlyOneControlPlaneMachineInitiali
1835
1835
controlPlaneInitMachineSecond ,
1836
1836
controlPlaneInitConfigSecond ,
1837
1837
}
1838
- myclient := fake .NewClientBuilder ().WithObjects (objects ... ).Build ()
1838
+ myclient := fake .NewClientBuilder ().WithObjects (objects ... ).WithStatusSubresource ( & bootstrapv1. KubeadmConfig {}). Build ()
1839
1839
k := & KubeadmConfigReconciler {
1840
1840
Client : myclient ,
1841
1841
KubeadmInitLock : & myInitLocker {},
0 commit comments