From 21d7aeeffdcef5300af30d14817faedecf4b8a38 Mon Sep 17 00:00:00 2001 From: "Schlotter, Christian" Date: Tue, 7 Sep 2021 16:57:48 +0200 Subject: [PATCH] controllers/openstackcluster_controller.go don't recreate status.network if already contains information Signed-off-by: Schlotter, Christian --- controllers/openstackcluster_controller.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/openstackcluster_controller.go b/controllers/openstackcluster_controller.go index 908bd05bdc..1a5144b62f 100644 --- a/controllers/openstackcluster_controller.go +++ b/controllers/openstackcluster_controller.go @@ -397,11 +397,12 @@ func reconcileNetworkComponents(log logr.Logger, osProviderClient *gophercloud.P handleUpdateOSCError(openStackCluster, errors.Errorf("failed to find only one network (result: %v): %v", networkList, err)) return errors.Errorf("failed to find only one network (result: %v): %v", networkList, err) } - openStackCluster.Status.Network = &infrav1.Network{ - ID: networkList[0].ID, - Name: networkList[0].Name, - Tags: networkList[0].Tags, + if openStackCluster.Status.Network == nil { + openStackCluster.Status.Network = &infrav1.Network{} } + openStackCluster.Status.Network.ID = networkList[0].ID + openStackCluster.Status.Network.Name = networkList[0].Name + openStackCluster.Status.Network.Tags = networkList[0].Tags subnetOpts := subnets.ListOpts(openStackCluster.Spec.Subnet) subnetOpts.NetworkID = networkList[0].ID