Skip to content

Commit

Permalink
do not set subnet's vlan empty on failure (#2445)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Mar 10, 2023
1 parent 0013484 commit 694059c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ func formatSubnet(subnet *kubeovnv1.Subnet, c *Controller) error {
}
if subnet.Spec.Vlan != "" {
if _, err := c.vlansLister.Get(subnet.Spec.Vlan); err != nil {
klog.Warningf("subnet %s reference a none exist vlan %s", subnet.Name, subnet.Spec.Vlan)
subnet.Spec.Vlan = ""
err = fmt.Errorf("failed to get vlan %s: %s", subnet.Spec.Vlan, err)
klog.Error(err)
return err
}
}
}
Expand Down

0 comments on commit 694059c

Please sign in to comment.