Skip to content

Commit

Permalink
fix reference to nil pointer
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Mar 26, 2024
1 parent 1173594 commit b1d26b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,15 +625,15 @@ func (c *Controller) syncSubnetCR() error {
klog.Error(err)
return err
}
for _, orisubnet := range subnets {
subnet := orisubnet.DeepCopy()
for _, cachedSubnet := range subnets {
subnet := cachedSubnet.DeepCopy()
if util.CheckProtocol(subnet.Spec.CIDRBlock) == kubeovnv1.ProtocolDual {
subnet, err = c.calcDualSubnetStatusIP(subnet)
} else {
subnet, err = c.calcSubnetStatusIP(subnet)
}
if err != nil {
klog.Errorf("failed to calculate subnet %s used ip: %v", subnet.Name, err)
klog.Errorf("failed to calculate subnet %s used ip: %v", cachedSubnet.Name, err)
return err
}

Expand Down

0 comments on commit b1d26b6

Please sign in to comment.