Skip to content

Commit

Permalink
fix: warning for empty chassis fixed (#1787)
Browse files Browse the repository at this point in the history
* fix: warning for empty chassis fixed
  • Loading branch information
lut777 authored Aug 11, 2022
1 parent 88531d5 commit 7674b85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ func (c *Controller) handleAddNode(key string) error {
return err
}

if err := c.RemoveRedundantChassis(node); err != nil {
if err := c.EnsureChassisOnlyForClusterNodes(node); err != nil {
return err
}

if err := c.retryDelDupChassis(util.ChasRetryTime, util.ChasRetryIntev+2, c.checkChassisDupl, node); err != nil {
if err := c.retryDelDupChassis(util.ChasRetryTime, util.ChasRetryIntev+2, c.EnsureChassisConsistency, node); err != nil {
return err
}

Expand Down Expand Up @@ -581,7 +581,7 @@ func (c *Controller) handleUpdateNode(key string) error {
return err
}

if err := c.retryDelDupChassis(util.ChasRetryTime, util.ChasRetryIntev+2, c.checkChassisDupl, node); err != nil {
if err := c.retryDelDupChassis(util.ChasRetryTime, util.ChasRetryIntev+2, c.EnsureChassisConsistency, node); err != nil {
return err
}

Expand Down Expand Up @@ -824,7 +824,7 @@ func (c *Controller) checkRouteExist(nextHop, cidrBlock, routePolicy string) (bo
return false, nil
}

func (c *Controller) checkChassisDupl(node *v1.Node) error {
func (c *Controller) EnsureChassisConsistency(node *v1.Node) error {
// notice that multiple chassises may arise and we are not prepared
chassisAdd, err := c.ovnLegacyClient.GetChassis(node.Name)
if err != nil {
Expand Down Expand Up @@ -994,7 +994,7 @@ func (c *Controller) checkAndUpdateNodePortGroup() error {
return nil
}

func (c *Controller) RemoveRedundantChassis(node *v1.Node) error {
func (c *Controller) EnsureChassisOnlyForClusterNodes(node *v1.Node) error {
chassisAdd, err := c.ovnLegacyClient.GetChassis(node.Name)
if err != nil {
klog.Errorf("failed to get node %s chassisID, %v", node.Name, err)
Expand Down Expand Up @@ -1025,7 +1025,7 @@ func (c *Controller) RemoveRedundantChassis(node *v1.Node) error {
}
}
}
return errors.New("chassis reset, reboot ovs-ovn on this node: " + node.Name)
return errors.New("chassis is empty, please check parameter and reboot ovs-ovn on this node: " + node.Name)
}
return nil
}
Expand Down

0 comments on commit 7674b85

Please sign in to comment.