Skip to content

Commit 578040d

Browse files
committed
nilpointer during clusterctl move
If .status.network is empty (e.g. during clusterctl move) the reconciliation will fail due a nil pointer. This commit skips the first reconciliation of openStackCluster.Spec.APIServerLoadBalancer.AllowedCIDRs after a clusterctl move. Signed-off-by: Mario Constanti <[email protected]>
1 parent 68a9ee6 commit 578040d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/cloud/services/loadbalancer/loadbalancer.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,13 @@ func (s *Service) ReconcileLoadBalancer(openStackCluster *infrav1.OpenStackClust
134134
}
135135

136136
if allowedCIDRsSupported {
137-
if err := s.getOrUpdateAllowedCIDRS(openStackCluster, listener); err != nil {
138-
return err
137+
// Skip reconciliation if network status is nil (e.g. during clusterctl move)
138+
if openStackCluster.Status.Network != nil {
139+
if err := s.getOrUpdateAllowedCIDRS(openStackCluster, listener); err != nil {
140+
return err
141+
}
142+
allowedCIDRs = listener.AllowedCIDRs
139143
}
140-
allowedCIDRs = listener.AllowedCIDRs
141144
}
142145
}
143146

0 commit comments

Comments
 (0)