Skip to content

Commit 4343958

Browse files
authored
Merge pull request #560 from qvicksilver/fix-#559
Make DisablePortSecurity compatible with platforms not using the port…
2 parents 78939ac + 3a6cf61 commit 4343958

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

pkg/cloud/services/networking/network.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,18 @@ func (s *Service) ReconcileNetwork(clusterName string, openStackCluster *infrav1
5757
return nil
5858
}
5959

60-
var portSecurityEnabled gophercloud.EnabledState
60+
var opts createOpts
6161
if openStackCluster.Spec.DisablePortSecurity {
62-
portSecurityEnabled = gophercloud.Disabled
62+
opts = createOpts{
63+
AdminStateUp: gophercloud.Enabled,
64+
Name: networkName,
65+
PortSecurityEnabled: gophercloud.Disabled,
66+
}
6367
} else {
64-
portSecurityEnabled = gophercloud.Enabled
65-
}
66-
opts := createOpts{
67-
AdminStateUp: gophercloud.Enabled,
68-
Name: networkName,
69-
PortSecurityEnabled: portSecurityEnabled,
68+
opts = createOpts{
69+
AdminStateUp: gophercloud.Enabled,
70+
Name: networkName,
71+
}
7072
}
7173
network, err := networks.Create(s.client, opts).Extract()
7274
if err != nil {

0 commit comments

Comments
 (0)