Skip to content

Commit

Permalink
fix: subnet CIDRConflict
Browse files Browse the repository at this point in the history
  • Loading branch information
fanriming committed Nov 4, 2020
1 parent d5b819b commit 67076d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func (c *Controller) handleAddOrUpdateSubnet(key string) error {
}

for _, sub := range subnetList {
if sub.Name != subnet.Name && sub.Spec.Vpc == sub.Spec.Vpc && util.CIDRConflict(sub.Spec.CIDRBlock, subnet.Spec.CIDRBlock) {
if sub.Spec.Vpc == subnet.Spec.Vpc && sub.Name != subnet.Name && util.CIDRConflict(sub.Spec.CIDRBlock, subnet.Spec.CIDRBlock) {
err = fmt.Errorf("subnet %s cidr %s conflict with subnet %s cidr %s", subnet.Name, subnet.Spec.CIDRBlock, sub.Name, sub.Spec.CIDRBlock)
klog.Error(err)
c.patchSubnetStatus(subnet, "ValidateLogicalSwitchFailed", err.Error())
Expand Down

0 comments on commit 67076d6

Please sign in to comment.