From 02b6157b11a868ab4573e122a99d5fd01a770e06 Mon Sep 17 00:00:00 2001 From: vie-serendipity <2733147505@qq.com> Date: Tue, 16 Jul 2024 10:21:09 +0800 Subject: [PATCH] chore: simplify code --- pkg/yurthub/proxy/autonomy/autonomy.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/yurthub/proxy/autonomy/autonomy.go b/pkg/yurthub/proxy/autonomy/autonomy.go index 76c4531bd8a..f92d1afa241 100644 --- a/pkg/yurthub/proxy/autonomy/autonomy.go +++ b/pkg/yurthub/proxy/autonomy/autonomy.go @@ -168,9 +168,7 @@ func (ap *AutonomyProxy) tryUpdateNodeConditions(tryNumber int, req *http.Reques func (ap *AutonomyProxy) updateNodeConditions(originalNode *v1.Node) (*v1.Node, bool) { node := originalNode.DeepCopy() - if _, ok := node.Annotations[projectinfo.GetAutonomyAnnotation()]; !ok { - setNodeAutonomyCondition(node, v1.ConditionFalse, "autonomy disabled", "The autonomy is disabled or this node is not edge node") - } else if node.Annotations[projectinfo.GetAutonomyAnnotation()] == "false" || node.Labels[projectinfo.GetEdgeWorkerLabelKey()] == "false" { + if node.Annotations[projectinfo.GetAutonomyAnnotation()] != "true" || node.Labels[projectinfo.GetEdgeWorkerLabelKey()] == "false" { setNodeAutonomyCondition(node, v1.ConditionFalse, "autonomy disabled", "The autonomy is disabled or this node is not edge node") } else { res := ap.cacheMgr.QueryCacheResult()