@@ -75,6 +75,12 @@ func restorev1alpha8Bastion(previous **infrav1.Bastion, dst **infrav1.Bastion) {
75
75
}
76
76
}
77
77
78
+ func restorev1alpha8Subnets (previous * []infrav1.SubnetFilter , dst * []infrav1.SubnetFilter ) {
79
+ if len (* previous ) > 1 {
80
+ * dst = append (* dst , (* previous )[1 :]... )
81
+ }
82
+ }
83
+
78
84
func restorev1alpha8ClusterStatus (previous * infrav1.OpenStackClusterStatus , dst * infrav1.OpenStackClusterStatus ) {
79
85
// It's (theoretically) possible in v1alpha8 to have Network nil but
80
86
// Router or APIServerLoadBalancer not nil. In hub-spoke-hub conversion this will
@@ -154,6 +160,12 @@ var v1alpha8OpenStackClusterRestorer = conversion.RestorerFor[*infrav1.OpenStack
154
160
},
155
161
restorev1alpha8Bastion ,
156
162
),
163
+ "subnets" : conversion .HashedFieldRestorer (
164
+ func (c * infrav1.OpenStackCluster ) * []infrav1.SubnetFilter {
165
+ return & c .Spec .Subnets
166
+ },
167
+ restorev1alpha8Subnets ,
168
+ ),
157
169
"status" : conversion .HashedFieldRestorer (
158
170
func (c * infrav1.OpenStackCluster ) * infrav1.OpenStackClusterStatus {
159
171
return & c .Status
@@ -234,6 +246,12 @@ var v1alpha8OpenStackClusterTemplateRestorer = conversion.RestorerFor[*infrav1.O
234
246
},
235
247
restorev1alpha8Bastion ,
236
248
),
249
+ "subnets" : conversion .HashedFieldRestorer (
250
+ func (c * infrav1.OpenStackClusterTemplate ) * []infrav1.SubnetFilter {
251
+ return & c .Spec .Template .Spec .Subnets
252
+ },
253
+ restorev1alpha8Subnets ,
254
+ ),
237
255
}
238
256
239
257
func (r * OpenStackClusterTemplate ) ConvertTo (dstRaw ctrlconversion.Hub ) error {
0 commit comments