Skip to content

Commit

Permalink
Merge pull request #989 from Daimler/chrischdi/network-prevent-overwr…
Browse files Browse the repository at this point in the history
…iting-existing

⚠️ Don't overwrite openstackcluster.status.network on reconciliation
  • Loading branch information
k8s-ci-robot authored Sep 8, 2021
2 parents 221d55b + 21d7aee commit ac9c503
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions controllers/openstackcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac9c503

Please sign in to comment.