Skip to content

Commit

Permalink
move chassis judge to the end of node processing
Browse files Browse the repository at this point in the history
  • Loading branch information
lut777 committed Dec 29, 2021
1 parent 636b946 commit c4956ac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,6 @@ func (c *Controller) handleAddNode(key string) error {
return err
}

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

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

var v4IP, v6IP, mac string
portName := fmt.Sprintf("node-%s", key)
if node.Annotations[util.AllocatedAnnotation] == "true" && node.Annotations[util.IpAddressAnnotation] != "" && node.Annotations[util.MacAddressAnnotation] != "" {
Expand Down Expand Up @@ -331,6 +323,14 @@ func (c *Controller) handleAddNode(key string) error {
return err
}

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

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

return nil
}

Expand Down

0 comments on commit c4956ac

Please sign in to comment.