summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillardHu <wei.hu@daocloud.io>2024-01-17 18:08:01 +0800
committerWillardHu <wei.hu@daocloud.io>2024-01-18 17:25:40 +0800
commit8bd1c1b4b2cb795131357eae68ca6ac0f96684da (patch)
tree6cbeeb009e514001899d9958a10de57fc16776bc
parentConstruction of cloudcore upgrading capability (diff)
downloadkubeedge-8bd1c1b4b2cb795131357eae68ca6ac0f96684da.tar.gz
Modify the command for upgrading edgenode
Signed-off-by: WillardHu <wei.hu@daocloud.io>
-rw-r--r--edge/pkg/edgehub/task/taskexecutor/node_upgrade.go2
-rw-r--r--keadm/cmd/keadm/app/cmd/cloud/upgrade.go18
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/cloudcore.go2
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/cloudcore_test.go15
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/helm_helper.go2
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/helm_helper_test.go15
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/values.go15
-rw-r--r--keadm/cmd/keadm/app/cmd/helm/values_test.go15
8 files changed, 80 insertions, 4 deletions
diff --git a/edge/pkg/edgehub/task/taskexecutor/node_upgrade.go b/edge/pkg/edgehub/task/taskexecutor/node_upgrade.go
index 8546ab96d..dacdb5f72 100644
--- a/edge/pkg/edgehub/task/taskexecutor/node_upgrade.go
+++ b/edge/pkg/edgehub/task/taskexecutor/node_upgrade.go
@@ -129,7 +129,7 @@ func upgrade(taskReq types.NodeTaskRequest) (event fsm.Event) {
func keadmUpgrade(upgradeReq commontypes.NodeUpgradeJobRequest, opts *options.EdgeCoreOptions) error {
klog.Infof("Begin to run upgrade command")
- upgradeCmd := fmt.Sprintf("keadm upgrade --upgradeID %s --historyID %s --fromVersion %s --toVersion %s --config %s --image %s > /tmp/keadm.log 2>&1",
+ upgradeCmd := fmt.Sprintf("keadm upgrade edge --upgradeID %s --historyID %s --fromVersion %s --toVersion %s --config %s --image %s > /tmp/keadm.log 2>&1",
upgradeReq.UpgradeID, upgradeReq.HistoryID, version.Get(), upgradeReq.Version, opts.ConfigFile, upgradeReq.Image)
// run upgrade cmd to upgrade edge node
diff --git a/keadm/cmd/keadm/app/cmd/cloud/upgrade.go b/keadm/cmd/keadm/app/cmd/cloud/upgrade.go
index e14810201..21081beb6 100644
--- a/keadm/cmd/keadm/app/cmd/cloud/upgrade.go
+++ b/keadm/cmd/keadm/app/cmd/cloud/upgrade.go
@@ -1,3 +1,18 @@
+/*
+Copyright 2024 The KubeEdge Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package cloud
import (
@@ -13,7 +28,8 @@ func NewCloudUpgrade() *cobra.Command {
cmd := &cobra.Command{
Use: "cloud",
Short: "Upgrade the cloud components",
- Long: "Upgrade the cloud components to the desired version, it uses helm to upgrade the installed release of cloudcore.",
+ Long: "Upgrade the cloud components to the desired version, " +
+ "it uses helm to upgrade the installed release of cloudcore chart, which includes all the cloud components",
RunE: func(cmd *cobra.Command, args []string) error {
tool := helm.NewCloudCoreHelmTool(opts.KubeConfig, opts.KubeEdgeVersion)
return tool.Upgrade(opts)
diff --git a/keadm/cmd/keadm/app/cmd/helm/cloudcore.go b/keadm/cmd/keadm/app/cmd/helm/cloudcore.go
index be1bbdb83..93618eccd 100644
--- a/keadm/cmd/keadm/app/cmd/helm/cloudcore.go
+++ b/keadm/cmd/keadm/app/cmd/helm/cloudcore.go
@@ -1,5 +1,5 @@
/*
-Copyright 2019 The KubeEdge Authors.
+Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/keadm/cmd/keadm/app/cmd/helm/cloudcore_test.go b/keadm/cmd/keadm/app/cmd/helm/cloudcore_test.go
index 35bdd8cfd..82b82faf7 100644
--- a/keadm/cmd/keadm/app/cmd/helm/cloudcore_test.go
+++ b/keadm/cmd/keadm/app/cmd/helm/cloudcore_test.go
@@ -1,3 +1,18 @@
+/*
+Copyright 2024 The KubeEdge Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package helm
import (
diff --git a/keadm/cmd/keadm/app/cmd/helm/helm_helper.go b/keadm/cmd/keadm/app/cmd/helm/helm_helper.go
index 6c2262c48..2cf5509fa 100644
--- a/keadm/cmd/keadm/app/cmd/helm/helm_helper.go
+++ b/keadm/cmd/keadm/app/cmd/helm/helm_helper.go
@@ -1,5 +1,5 @@
/*
-Copyright 2019 The KubeEdge Authors.
+Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/keadm/cmd/keadm/app/cmd/helm/helm_helper_test.go b/keadm/cmd/keadm/app/cmd/helm/helm_helper_test.go
index e83d9feb0..b2380b0be 100644
--- a/keadm/cmd/keadm/app/cmd/helm/helm_helper_test.go
+++ b/keadm/cmd/keadm/app/cmd/helm/helm_helper_test.go
@@ -1,3 +1,18 @@
+/*
+Copyright 2024 The KubeEdge Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package helm
import "testing"
diff --git a/keadm/cmd/keadm/app/cmd/helm/values.go b/keadm/cmd/keadm/app/cmd/helm/values.go
index 9c1c47454..3cf803eec 100644
--- a/keadm/cmd/keadm/app/cmd/helm/values.go
+++ b/keadm/cmd/keadm/app/cmd/helm/values.go
@@ -1,3 +1,18 @@
+/*
+Copyright 2024 The KubeEdge Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package helm
import (
diff --git a/keadm/cmd/keadm/app/cmd/helm/values_test.go b/keadm/cmd/keadm/app/cmd/helm/values_test.go
index 93d3d2b41..26d1e0c0a 100644
--- a/keadm/cmd/keadm/app/cmd/helm/values_test.go
+++ b/keadm/cmd/keadm/app/cmd/helm/values_test.go
@@ -1,3 +1,18 @@
+/*
+Copyright 2024 The KubeEdge Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
package helm
import (