Skip to content

Commit

Permalink
Check cluster router status before reading IP list
Browse files Browse the repository at this point in the history
  • Loading branch information
capaca committed Mar 27, 2024
1 parent d5e7822 commit a0b5cb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cloud/services/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ func (s *Service) getOrUpdateAllowedCIDRS(openStackCluster *infrav1.OpenStackClu
allowedCIDRs = append(allowedCIDRs, subnet.CIDR)
}
}
}

if len(openStackCluster.Status.Router.IPs) > 0 {
allowedCIDRs = append(allowedCIDRs, openStackCluster.Status.Router.IPs...)
}
if openStackCluster.Status.Router != nil && len(openStackCluster.Status.Router.IPs) > 0 {
allowedCIDRs = append(allowedCIDRs, openStackCluster.Status.Router.IPs...)
}
}

Expand Down

0 comments on commit a0b5cb1

Please sign in to comment.