@@ -109,10 +109,6 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
109109 for idx := int64 (0 ); idx < total ; idx ++ {
110110 zone := mpool .Zones [int (idx )% len (mpool .Zones )]
111111 azureMachine := & capz.AzureMachine {
112- TypeMeta : metav1.TypeMeta {
113- APIVersion : "infrastructure.cluster.x-k8s.io/v1beta1" ,
114- Kind : "AzureMachine" ,
115- },
116112 ObjectMeta : metav1.ObjectMeta {
117113 Name : fmt .Sprintf ("%s-%s-%d" , clusterID , pool .Name , idx ),
118114 Labels : map [string ]string {
@@ -131,6 +127,7 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
131127 SecurityProfile : securityProfile ,
132128 },
133129 }
130+ azureMachine .SetGroupVersionKind (capz .GroupVersion .WithKind ("AzureMachine" ))
134131 result = append (result , & asset.RuntimeFile {
135132 File : asset.File {Filename : fmt .Sprintf ("10_inframachine_%s.yaml" , azureMachine .Name )},
136133 Object : azureMachine ,
@@ -149,12 +146,13 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
149146 DataSecretName : ptr .To (fmt .Sprintf ("%s-%s" , clusterID , role )),
150147 },
151148 InfrastructureRef : v1.ObjectReference {
152- APIVersion : "infrastructure.cluster.x-k8s.io/v1beta2" ,
149+ APIVersion : capz . GroupVersion . String () ,
153150 Kind : "AzureMachine" ,
154151 Name : azureMachine .Name ,
155152 },
156153 },
157154 }
155+ controlPlaneMachine .SetGroupVersionKind (capi .GroupVersion .WithKind ("Machine" ))
158156
159157 result = append (result , & asset.RuntimeFile {
160158 File : asset.File {Filename : fmt .Sprintf ("10_machine_%s.yaml" , azureMachine .Name )},
@@ -163,10 +161,6 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
163161 }
164162
165163 bootstrapAzureMachine := & capz.AzureMachine {
166- TypeMeta : metav1.TypeMeta {
167- APIVersion : "infrastructure.cluster.x-k8s.io/v1beta1" ,
168- Kind : "AzureMachine" ,
169- },
170164 ObjectMeta : metav1.ObjectMeta {
171165 Name : capiutils .GenerateBoostrapMachineName (clusterID ),
172166 Labels : map [string ]string {
@@ -186,6 +180,7 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
186180 SecurityProfile : securityProfile ,
187181 },
188182 }
183+ bootstrapAzureMachine .SetGroupVersionKind (capz .GroupVersion .WithKind ("AzureMachine" ))
189184
190185 result = append (result , & asset.RuntimeFile {
191186 File : asset.File {Filename : fmt .Sprintf ("10_inframachine_%s.yaml" , bootstrapAzureMachine .Name )},
@@ -205,12 +200,13 @@ func GenerateMachines(platform *azure.Platform, pool *types.MachinePool, userDat
205200 DataSecretName : ptr .To (fmt .Sprintf ("%s-%s" , clusterID , "bootstrap" )),
206201 },
207202 InfrastructureRef : v1.ObjectReference {
208- APIVersion : "infrastructure.cluster.x-k8s.io/v1beta2" ,
203+ APIVersion : capz . GroupVersion . String () ,
209204 Kind : "AzureMachine" ,
210205 Name : bootstrapAzureMachine .Name ,
211206 },
212207 },
213208 }
209+ bootstrapMachine .SetGroupVersionKind (capi .GroupVersion .WithKind ("Machine" ))
214210
215211 result = append (result , & asset.RuntimeFile {
216212 File : asset.File {Filename : fmt .Sprintf ("10_machine_%s.yaml" , bootstrapMachine .Name )},
0 commit comments