Skip to content

Commit 9f18453

Browse files
MaysaMacedopierreprinetti
authored andcommitted
OpenStack: Avoid creation of FIP when no external Network exists
When no external network is set on CAPO Cluster status it's not possible to create a Floating IP for the bootstrap. This commit fixes the issue by skipping the creation.
1 parent f1a5073 commit 9f18453

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/infrastructure/openstack/postprovision/floatingips.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import (
1818

1919
// FloatingIPs creates and attaches a Floating IP to the Bootstrap Machine.
2020
func FloatingIPs(ctx context.Context, c client.Client, cluster *capo.OpenStackCluster, installConfig *installconfig.InstallConfig, infraID string) error {
21+
if cluster.Status.ExternalNetwork == nil {
22+
return nil
23+
}
2124
bootstrapMachine := &capo.OpenStackMachine{}
2225
key := client.ObjectKey{
2326
Name: capiutils.GenerateBoostrapMachineName(infraID),

0 commit comments

Comments
 (0)