@@ -210,6 +210,13 @@ func restorev1beta1ClusterSpec(previous *infrav1.OpenStackClusterSpec, dst *infr
210
210
dst .APIServerLoadBalancer .Enabled = previous .APIServerLoadBalancer .Enabled
211
211
}
212
212
optional .RestoreString (& previous .APIServerLoadBalancer .Provider , & dst .APIServerLoadBalancer .Provider )
213
+
214
+ if previous .APIServerLoadBalancer .Network != nil {
215
+ dst .APIServerLoadBalancer .Network = previous .APIServerLoadBalancer .Network
216
+ }
217
+ if previous .APIServerLoadBalancer .Subnets != nil {
218
+ dst .APIServerLoadBalancer .Subnets = previous .APIServerLoadBalancer .Subnets
219
+ }
213
220
}
214
221
if dst .APIServerLoadBalancer .IsZero () {
215
222
dst .APIServerLoadBalancer = previous .APIServerLoadBalancer
@@ -294,6 +301,18 @@ func Convert_v1alpha6_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *O
294
301
return nil
295
302
}
296
303
304
+ func Convert_v1beta1_APIServerLoadBalancer_To_v1alpha6_APIServerLoadBalancer (in * infrav1.APIServerLoadBalancer , out * APIServerLoadBalancer , s apiconversion.Scope ) error {
305
+ return autoConvert_v1beta1_APIServerLoadBalancer_To_v1alpha6_APIServerLoadBalancer (in , out , s )
306
+ }
307
+
308
+ func Convert_v1beta1_LoadBalancer_To_v1alpha6_LoadBalancer (in * infrav1.LoadBalancer , out * LoadBalancer , s apiconversion.Scope ) error {
309
+ return autoConvert_v1beta1_LoadBalancer_To_v1alpha6_LoadBalancer (in , out , s )
310
+ }
311
+
312
+ func Convert_v1alpha6_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer (in * APIServerLoadBalancer , out * infrav1.APIServerLoadBalancer , s apiconversion.Scope ) error {
313
+ return autoConvert_v1alpha6_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer (in , out , s )
314
+ }
315
+
297
316
func Convert_v1beta1_OpenStackClusterSpec_To_v1alpha6_OpenStackClusterSpec (in * infrav1.OpenStackClusterSpec , out * OpenStackClusterSpec , s apiconversion.Scope ) error {
298
317
err := autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha6_OpenStackClusterSpec (in , out , s )
299
318
if err != nil {
@@ -375,6 +394,10 @@ func restorev1beta1ClusterStatus(previous *infrav1.OpenStackClusterStatus, dst *
375
394
dst .BastionSecurityGroup = previous .BastionSecurityGroup
376
395
377
396
restorev1beta1BastionStatus (previous .Bastion , dst .Bastion )
397
+
398
+ if previous .APIServerLoadBalancer != nil {
399
+ dst .APIServerLoadBalancer = previous .APIServerLoadBalancer
400
+ }
378
401
}
379
402
380
403
func Convert_v1beta1_OpenStackClusterStatus_To_v1alpha6_OpenStackClusterStatus (in * infrav1.OpenStackClusterStatus , out * OpenStackClusterStatus , s apiconversion.Scope ) error {
@@ -390,7 +413,16 @@ func Convert_v1beta1_OpenStackClusterStatus_To_v1alpha6_OpenStackClusterStatus(i
390
413
}
391
414
392
415
out .Network .Router = (* Router )(in .Router )
393
- out .Network .APIServerLoadBalancer = (* LoadBalancer )(in .APIServerLoadBalancer )
416
+ if in .APIServerLoadBalancer != nil {
417
+ out .Network .APIServerLoadBalancer = & LoadBalancer {
418
+ Name : in .APIServerLoadBalancer .Name ,
419
+ ID : in .APIServerLoadBalancer .ID ,
420
+ IP : in .APIServerLoadBalancer .IP ,
421
+ InternalIP : in .APIServerLoadBalancer .InternalIP ,
422
+ AllowedCIDRs : in .APIServerLoadBalancer .AllowedCIDRs ,
423
+ Tags : in .APIServerLoadBalancer .Tags ,
424
+ }
425
+ }
394
426
}
395
427
396
428
return nil
@@ -405,7 +437,16 @@ func Convert_v1alpha6_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(i
405
437
// Router and APIServerLoadBalancer have been moved out of Network in v1beta1
406
438
if in .Network != nil {
407
439
out .Router = (* infrav1 .Router )(in .Network .Router )
408
- out .APIServerLoadBalancer = (* infrav1 .LoadBalancer )(in .Network .APIServerLoadBalancer )
440
+ if in .Network .APIServerLoadBalancer != nil {
441
+ out .APIServerLoadBalancer = & infrav1.LoadBalancer {
442
+ Name : in .Network .APIServerLoadBalancer .Name ,
443
+ ID : in .Network .APIServerLoadBalancer .ID ,
444
+ IP : in .Network .APIServerLoadBalancer .IP ,
445
+ InternalIP : in .Network .APIServerLoadBalancer .InternalIP ,
446
+ AllowedCIDRs : in .Network .APIServerLoadBalancer .AllowedCIDRs ,
447
+ Tags : in .Network .APIServerLoadBalancer .Tags ,
448
+ }
449
+ }
409
450
}
410
451
411
452
return nil
0 commit comments