@@ -102,7 +102,7 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnEarlyIfKubeadmConfigIsReady(t *
102102 config := newKubeadmConfig (metav1 .NamespaceDefault , "cfg" )
103103 addKubeadmConfigToMachine (config , machine )
104104
105- config .Status .Ready = true
105+ config .Status .Initialization = & bootstrapv1. KubeadmConfigInitializationStatus { DataSecretCreated : true }
106106
107107 objects := []client.Object {
108108 cluster ,
@@ -157,7 +157,7 @@ func TestKubeadmConfigReconciler_TestSecretOwnerReferenceReconciliation(t *testi
157157 },
158158 Type : corev1 .SecretTypeBootstrapToken ,
159159 }
160- config .Status .Ready = true
160+ config .Status .Initialization = & bootstrapv1. KubeadmConfigInitializationStatus { DataSecretCreated : true }
161161
162162 objects := []client.Object {
163163 config ,
@@ -532,7 +532,8 @@ func TestKubeadmConfigReconciler_Reconcile_GenerateCloudConfigData(t *testing.T)
532532
533533 cfg , err := getKubeadmConfig (myclient , "control-plane-init-cfg" , metav1 .NamespaceDefault )
534534 g .Expect (err ).ToNot (HaveOccurred ())
535- g .Expect (cfg .Status .Ready ).To (BeTrue ())
535+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
536+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
536537 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
537538 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
538539 assertHasTrueCondition (g , myclient , request , bootstrapv1 .CertificatesAvailableCondition )
@@ -714,7 +715,8 @@ func TestReconcileIfJoinCertificatesAvailableConditioninNodesAndControlPlaneIsRe
714715
715716 cfg , err := getKubeadmConfig (myclient , rt .configName , metav1 .NamespaceDefault )
716717 g .Expect (err ).ToNot (HaveOccurred ())
717- g .Expect (cfg .Status .Ready ).To (BeTrue ())
718+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
719+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
718720 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
719721 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
720722 assertHasTrueCondition (g , myclient , request , bootstrapv1 .DataSecretAvailableCondition )
@@ -791,7 +793,8 @@ func TestReconcileIfJoinNodePoolsAndControlPlaneIsReady(t *testing.T) {
791793
792794 cfg , err := getKubeadmConfig (myclient , rt .configName , metav1 .NamespaceDefault )
793795 g .Expect (err ).ToNot (HaveOccurred ())
794- g .Expect (cfg .Status .Ready ).To (BeTrue ())
796+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
797+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
795798 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
796799 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
797800
@@ -892,7 +895,8 @@ func TestBootstrapDataFormat(t *testing.T) {
892895 // Verify the KubeadmConfig resource state is correct.
893896 cfg , err := getKubeadmConfig (myclient , configName , metav1 .NamespaceDefault )
894897 g .Expect (err ).ToNot (HaveOccurred ())
895- g .Expect (cfg .Status .Ready ).To (BeTrue ())
898+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
899+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
896900 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
897901
898902 // Read the secret containing the bootstrap data which was generated by the
@@ -997,7 +1001,8 @@ func TestKubeadmConfigSecretCreatedStatusNotPatched(t *testing.T) {
9971001
9981002 cfg , err := getKubeadmConfig (myclient , "worker-join-cfg" , metav1 .NamespaceDefault )
9991003 g .Expect (err ).ToNot (HaveOccurred ())
1000- g .Expect (cfg .Status .Ready ).To (BeTrue ())
1004+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
1005+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
10011006 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
10021007 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
10031008}
@@ -1051,7 +1056,8 @@ func TestBootstrapTokenTTLExtension(t *testing.T) {
10511056
10521057 cfg , err := getKubeadmConfig (myclient , "worker-join-cfg" , metav1 .NamespaceDefault )
10531058 g .Expect (err ).ToNot (HaveOccurred ())
1054- g .Expect (cfg .Status .Ready ).To (BeTrue ())
1059+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
1060+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
10551061 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
10561062 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
10571063
@@ -1067,7 +1073,8 @@ func TestBootstrapTokenTTLExtension(t *testing.T) {
10671073
10681074 cfg , err = getKubeadmConfig (myclient , "control-plane-join-cfg" , metav1 .NamespaceDefault )
10691075 g .Expect (err ).ToNot (HaveOccurred ())
1070- g .Expect (cfg .Status .Ready ).To (BeTrue ())
1076+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
1077+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
10711078 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
10721079 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
10731080
@@ -1297,7 +1304,8 @@ func TestBootstrapTokenRotationMachinePool(t *testing.T) {
12971304
12981305 cfg , err := getKubeadmConfig (myclient , "workerpool-join-cfg" , metav1 .NamespaceDefault )
12991306 g .Expect (err ).ToNot (HaveOccurred ())
1300- g .Expect (cfg .Status .Ready ).To (BeTrue ())
1307+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
1308+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
13011309 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
13021310 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
13031311
@@ -1489,7 +1497,8 @@ func TestBootstrapTokenRefreshIfTokenSecretCleaned(t *testing.T) {
14891497
14901498 cfg , err := getKubeadmConfig (myclient , "worker-join-cfg" , metav1 .NamespaceDefault )
14911499 g .Expect (err ).ToNot (HaveOccurred ())
1492- g .Expect (cfg .Status .Ready ).To (BeTrue ())
1500+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
1501+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
14931502 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
14941503 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
14951504 g .Expect (cfg .Spec .JoinConfiguration .Discovery .BootstrapToken .Token ).ToNot (BeEmpty ())
@@ -1562,7 +1571,8 @@ func TestBootstrapTokenRefreshIfTokenSecretCleaned(t *testing.T) {
15621571
15631572 cfg , err := getKubeadmConfig (myclient , "workerpool-join-cfg" , metav1 .NamespaceDefault )
15641573 g .Expect (err ).ToNot (HaveOccurred ())
1565- g .Expect (cfg .Status .Ready ).To (BeTrue ())
1574+ g .Expect (cfg .Status .Initialization ).ToNot (BeNil ())
1575+ g .Expect (cfg .Status .Initialization .DataSecretCreated ).To (BeTrue ())
15661576 g .Expect (cfg .Status .DataSecretName ).NotTo (BeNil ())
15671577 g .Expect (cfg .Status .ObservedGeneration ).NotTo (BeNil ())
15681578 g .Expect (cfg .Spec .JoinConfiguration .Discovery .BootstrapToken .Token ).ToNot (BeEmpty ())
@@ -2791,7 +2801,7 @@ func TestKubeadmConfigReconciler_Reconcile_v1beta2_conditions(t *testing.T) {
27912801 name : "conditions should be true after upgrading to v1beta2" ,
27922802 config : func () * bootstrapv1.KubeadmConfig {
27932803 c := kubeadmConfig .DeepCopy ()
2794- c .Status .Ready = true
2804+ c .Status .Initialization = & bootstrapv1. KubeadmConfigInitializationStatus { DataSecretCreated : true }
27952805 return c
27962806 }(),
27972807 machine : machine .DeepCopy (),
0 commit comments