Skip to content

Commit 21d7aee

Browse files
committed
controllers/openstackcluster_controller.go don't recreate status.network if already contains information
Signed-off-by: Schlotter, Christian <[email protected]>
1 parent 1576e9c commit 21d7aee

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

controllers/openstackcluster_controller.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,12 @@ func reconcileNetworkComponents(log logr.Logger, osProviderClient *gophercloud.P
397397
handleUpdateOSCError(openStackCluster, errors.Errorf("failed to find only one network (result: %v): %v", networkList, err))
398398
return errors.Errorf("failed to find only one network (result: %v): %v", networkList, err)
399399
}
400-
openStackCluster.Status.Network = &infrav1.Network{
401-
ID: networkList[0].ID,
402-
Name: networkList[0].Name,
403-
Tags: networkList[0].Tags,
400+
if openStackCluster.Status.Network == nil {
401+
openStackCluster.Status.Network = &infrav1.Network{}
404402
}
403+
openStackCluster.Status.Network.ID = networkList[0].ID
404+
openStackCluster.Status.Network.Name = networkList[0].Name
405+
openStackCluster.Status.Network.Tags = networkList[0].Tags
405406

406407
subnetOpts := subnets.ListOpts(openStackCluster.Spec.Subnet)
407408
subnetOpts.NetworkID = networkList[0].ID

0 commit comments

Comments
 (0)