Skip to content

Commit

Permalink
fix log
Browse files Browse the repository at this point in the history
  • Loading branch information
bobz965 committed Aug 9, 2023
1 parent ff2c0a2 commit 9ff369b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,14 +995,13 @@ func (c *Controller) UpdateChassisTag(node *v1.Node) error {
// kube-ovn-cni not ready to set chassis
return nil
}
klog.Infof("validate chassis for node %s, chassis %s", node.Name, annoChassisName)
chassis, err := c.ovnSbClient.GetChassis(annoChassisName, false)
if err != nil {
klog.Errorf("failed to get node %s chassis: %s, %v", node.Name, annoChassisName, err)
return err
}
if chassis.ExternalIDs == nil || chassis.ExternalIDs[util.ExternalIDsNodeKey] != node.Name {
klog.Infof("init tag for node %s, chassis %s, host name %s", node.Name, annoChassisName, node.Name)
if chassis.ExternalIDs == nil || chassis.ExternalIDs["vendor"] != util.CniTypeName {
klog.Infof("init tag %s for node %s chassis", util.CniTypeName, node.Name)
if err = c.ovnSbClient.UpdateChassisTag(chassis.Name, node.Name); err != nil {
return fmt.Errorf("failed to init chassis tag, %v", err)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/util/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package util
const (
CniTypeName = "kube-ovn"

ExternalIDsNodeKey = "node"

ControllerName = "kube-ovn-controller"

AllocatedAnnotation = "ovn.kubernetes.io/allocated"
Expand Down

0 comments on commit 9ff369b

Please sign in to comment.