From 55ca9557d7158eaa69c642bbb95a8d3462d4013d Mon Sep 17 00:00:00 2001 From: JameKeal <70508195+JameKeal@users.noreply.github.com> Date: Tue, 31 Aug 2021 18:21:11 +0800 Subject: [PATCH] bug fix for autonomous (#441) * auto open the autonomous when convert edgenode * Update edgenode.go fix the bug: Operate node but node is not latest. --- pkg/yurtctl/cmd/convert/edgenode.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/yurtctl/cmd/convert/edgenode.go b/pkg/yurtctl/cmd/convert/edgenode.go index fab3a101418..f30f3b122dc 100644 --- a/pkg/yurtctl/cmd/convert/edgenode.go +++ b/pkg/yurtctl/cmd/convert/edgenode.go @@ -284,7 +284,14 @@ func (c *ConvertEdgeNodeOptions) RunConvertEdgeNode() (err error) { if err != nil { return err } - _, err = kubeutil.LabelNode(c.clientSet, node, projectinfo.GetEdgeWorkerLabelKey(), "true") + node, err = kubeutil.LabelNode(c.clientSet, node, projectinfo.GetEdgeWorkerLabelKey(), "true") + if err != nil { + return err + } + + // 3.6. open the autonomous + klog.Infof("open the %s autonomous", nodeName) + _, err = kubeutil.AnnotateNode(c.clientSet, node, constants.AnnotationAutonomy, "true") if err != nil { return err }