From 9ff369b34c06ec8c45f647ae5944c5ef0a69be12 Mon Sep 17 00:00:00 2001 From: bobz965 Date: Wed, 9 Aug 2023 17:42:36 +0800 Subject: [PATCH] fix log --- pkg/controller/node.go | 5 ++--- pkg/util/const.go | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/controller/node.go b/pkg/controller/node.go index 385628b4365..08125781faa 100644 --- a/pkg/controller/node.go +++ b/pkg/controller/node.go @@ -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) } diff --git a/pkg/util/const.go b/pkg/util/const.go index ef828b40d6d..83ad8a71a28 100644 --- a/pkg/util/const.go +++ b/pkg/util/const.go @@ -3,8 +3,6 @@ package util const ( CniTypeName = "kube-ovn" - ExternalIDsNodeKey = "node" - ControllerName = "kube-ovn-controller" AllocatedAnnotation = "ovn.kubernetes.io/allocated"