Skip to content

Commit

Permalink
chore: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
vie-serendipity committed Jul 16, 2024
1 parent c0148dd commit 02b6157
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/yurthub/proxy/autonomy/autonomy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 02b6157

Please sign in to comment.