@@ -86,6 +86,10 @@ func restorev1alpha8ClusterStatus(previous *infrav1.OpenStackClusterStatus, dst
8686 if previous .Bastion != nil {
8787 dst .Bastion .ReferencedResources = previous .Bastion .ReferencedResources
8888 }
89+
90+ if previous .AllNodesSecurityGroup != nil {
91+ dst .AllNodesSecurityGroup = previous .AllNodesSecurityGroup
92+ }
8993}
9094
9195func restorev1alpha6ClusterSpec (previous * OpenStackClusterSpec , dst * OpenStackClusterSpec ) {
@@ -128,6 +132,11 @@ var v1alpha6OpenStackClusterRestorer = conversion.RestorerFor[*OpenStackCluster]
128132}
129133
130134var v1alpha8OpenStackClusterRestorer = conversion.RestorerFor [* infrav1.OpenStackCluster ]{
135+ "managedSecurityGroups" : conversion .UnconditionalFieldRestorer (
136+ func (c * infrav1.OpenStackCluster ) * * infrav1.SecurityGroupsSpec {
137+ return & c .Spec .ManagedSecurityGroups
138+ },
139+ ),
131140 "externalNetwork" : conversion .UnconditionalFieldRestorer (
132141 func (c * infrav1.OpenStackCluster ) * infrav1.NetworkFilter {
133142 return & c .Spec .ExternalNetwork
@@ -208,6 +217,11 @@ var v1alpha6OpenStackClusterTemplateRestorer = conversion.RestorerFor[*OpenStack
208217}
209218
210219var v1alpha8OpenStackClusterTemplateRestorer = conversion.RestorerFor [* infrav1.OpenStackClusterTemplate ]{
220+ "managedSecurityGroups" : conversion .UnconditionalFieldRestorer (
221+ func (c * infrav1.OpenStackClusterTemplate ) * * infrav1.SecurityGroupsSpec {
222+ return & c .Spec .Template .Spec .ManagedSecurityGroups
223+ },
224+ ),
211225 "externalNetwork" : conversion .UnconditionalFieldRestorer (
212226 func (c * infrav1.OpenStackClusterTemplate ) * infrav1.NetworkFilter {
213227 return & c .Spec .Template .Spec .ExternalNetwork
@@ -486,6 +500,10 @@ func Convert_v1alpha8_OpenStackClusterSpec_To_v1alpha6_OpenStackClusterSpec(in *
486500 out .ExternalNetworkID = in .ExternalNetwork .ID
487501 }
488502
503+ if in .ManagedSecurityGroups != nil && in .ManagedSecurityGroups .Enabled {
504+ out .ManagedSecurityGroups = true
505+ }
506+
489507 return nil
490508}
491509
@@ -501,6 +519,12 @@ func Convert_v1alpha6_OpenStackClusterSpec_To_v1alpha8_OpenStackClusterSpec(in *
501519 }
502520 }
503521
522+ if in .ManagedSecurityGroups {
523+ out .ManagedSecurityGroups = & infrav1.SecurityGroupsSpec {
524+ Enabled : true ,
525+ }
526+ }
527+
504528 return nil
505529}
506530
@@ -780,3 +804,12 @@ func Convert_v1alpha8_Bastion_To_v1alpha6_Bastion(in *infrav1.Bastion, out *Bast
780804 out .Instance .FloatingIP = in .FloatingIP
781805 return nil
782806}
807+
808+ func Convert_v1alpha8_SecurityGroupRule_To_v1alpha6_SecurityGroupRule (in * infrav1.SecurityGroupRule , out * SecurityGroupRule , s apiconversion.Scope ) error {
809+ err := autoConvert_v1alpha8_SecurityGroupRule_To_v1alpha6_SecurityGroupRule (in , out , s )
810+ if err != nil {
811+ return err
812+ }
813+
814+ return nil
815+ }
0 commit comments