summaryrefslogtreecommitdiff
path: root/keadm
diff options
context:
space:
mode:
authorShelley-BaoYue <baoyue2@huawei.com>2023-08-18 15:14:34 +0800
committerShelley-BaoYue <baoyue2@huawei.com>2023-08-21 21:13:46 +0800
commit833346c40013fca6224534c573fd84c7e38bda4b (patch)
treeef9847cf9c0faa9deb36e7d986db6867ecc9b1a5 /keadm
parentupdate go version to 1.19 (diff)
downloadkubeedge-833346c40013fca6224534c573fd84c7e38bda4b.tar.gz
fix lint
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
Diffstat (limited to 'keadm')
-rw-r--r--keadm/cmd/keadm/app/cmd/common/config.go2
-rw-r--r--keadm/cmd/keadm/app/cmd/common/types.go18
-rw-r--r--keadm/cmd/keadm/app/cmd/deprecated/init.go4
-rw-r--r--keadm/cmd/keadm/app/cmd/deprecated/join.go4
-rw-r--r--keadm/cmd/keadm/app/cmd/util/exec.go2
-rw-r--r--keadm/cmd/keadm/app/cmd/util/k8sinstaller.go14
-rw-r--r--keadm/cmd/keadm/app/cmd/util/mqttinstaller.go8
-rw-r--r--keadm/cmd/keadm/app/keadm.go2
8 files changed, 27 insertions, 27 deletions
diff --git a/keadm/cmd/keadm/app/cmd/common/config.go b/keadm/cmd/keadm/app/cmd/common/config.go
index a63526896..dc675ef4c 100644
--- a/keadm/cmd/keadm/app/cmd/common/config.go
+++ b/keadm/cmd/keadm/app/cmd/common/config.go
@@ -22,7 +22,7 @@ import (
"sigs.k8s.io/yaml"
)
-//Write2File writes data into a file in path
+// Write2File writes data into a file in path
func Write2File(path string, data interface{}) error {
d, err := yaml.Marshal(data)
if err != nil {
diff --git a/keadm/cmd/keadm/app/cmd/common/types.go b/keadm/cmd/keadm/app/cmd/common/types.go
index 41ab8873c..1c2cf351a 100644
--- a/keadm/cmd/keadm/app/cmd/common/types.go
+++ b/keadm/cmd/keadm/app/cmd/common/types.go
@@ -20,7 +20,7 @@ import (
"github.com/blang/semver"
)
-//InitBaseOptions has the kubeedge cloud deprecated init base information filled by CLI
+// InitBaseOptions has the kubeedge cloud deprecated init base information filled by CLI
type InitBaseOptions struct {
KubeEdgeVersion string
KubeConfig string
@@ -30,7 +30,7 @@ type InitBaseOptions struct {
TarballPath string
}
-//InitOptions has the kubeedge cloud init information filled by CLI
+// InitOptions has the kubeedge cloud init information filled by CLI
type InitOptions struct {
KubeConfig string
KubeEdgeVersion string
@@ -45,7 +45,7 @@ type InitOptions struct {
DryRun bool
}
-//JoinOptions has the kubeedge cloud init information filled by CLI
+// JoinOptions has the kubeedge cloud init information filled by CLI
type JoinOptions struct {
InitBaseOptions
CertPath string
@@ -110,10 +110,10 @@ type DiagnoseObject struct {
Use string
}
-//ModuleRunning is defined to know the running status of KubeEdge components
+// ModuleRunning is defined to know the running status of KubeEdge components
type ModuleRunning uint8
-//Different possible values for ModuleRunning type
+// Different possible values for ModuleRunning type
const (
NoneRunning ModuleRunning = iota
KubeEdgeCloudRunning
@@ -123,7 +123,7 @@ const (
// ComponentType is the type of KubeEdge components, cloudcore or edgecore
type ComponentType string
-//All Component type
+// All Component type
const (
CloudCore ComponentType = "cloudcore"
EdgeCore ComponentType = "edgecore"
@@ -135,13 +135,13 @@ type InstallOptions struct {
TarballPath string
}
-//ToolsInstaller interface for tools with install and teardown methods.
+// ToolsInstaller interface for tools with install and teardown methods.
type ToolsInstaller interface {
InstallTools() error
TearDown() error
}
-//OSTypeInstaller interface for methods to be executed over a specified OS distribution type
+// OSTypeInstaller interface for methods to be executed over a specified OS distribution type
type OSTypeInstaller interface {
InstallMQTT() error
IsK8SComponentInstalled(string, string) error
@@ -152,7 +152,7 @@ type OSTypeInstaller interface {
IsKubeEdgeProcessRunning(string) (bool, error)
}
-//FlagData stores value and default value of the flags used in this command
+// FlagData stores value and default value of the flags used in this command
type FlagData struct {
Val interface{}
DefVal interface{}
diff --git a/keadm/cmd/keadm/app/cmd/deprecated/init.go b/keadm/cmd/keadm/app/cmd/deprecated/init.go
index 3d3e4ff50..5c9754785 100644
--- a/keadm/cmd/keadm/app/cmd/deprecated/init.go
+++ b/keadm/cmd/keadm/app/cmd/deprecated/init.go
@@ -76,7 +76,7 @@ func NewDeprecatedCloudInit() *cobra.Command {
return cmd
}
-//newInitOptions will initialise new instance of options everytime
+// newInitOptions will initialise new instance of options everytime
func newInitOptions() *types.InitBaseOptions {
opts := &types.InitBaseOptions{}
opts.KubeConfig = types.DefaultKubeConfig
@@ -104,7 +104,7 @@ func addInitFlags(cmd *cobra.Command, initOpts *types.InitBaseOptions) {
"Use this key to set the temp directory path for KubeEdge tarball, if not exist, download it")
}
-//Add2CloudToolsList Reads the flagData (containing val and default val) and join options to fill the list of tools.
+// Add2CloudToolsList Reads the flagData (containing val and default val) and join options to fill the list of tools.
func Add2CloudToolsList(toolList map[string]types.ToolsInstaller, flagData map[string]types.FlagData, initOptions *types.InitBaseOptions) error {
var kubeVer string
flgData, ok := flagData[types.KubeEdgeVersion]
diff --git a/keadm/cmd/keadm/app/cmd/deprecated/join.go b/keadm/cmd/keadm/app/cmd/deprecated/join.go
index 8748baf9e..849ed7ac1 100644
--- a/keadm/cmd/keadm/app/cmd/deprecated/join.go
+++ b/keadm/cmd/keadm/app/cmd/deprecated/join.go
@@ -32,7 +32,7 @@ import (
var (
edgeJoinLongDescription = `
-Deprecated:
+Deprecated:
"keadm deprecated join" command bootstraps KubeEdge's worker node (at the edge) component.
It will also connect with cloud component to receive
further instructions and forward telemetry data from
@@ -88,7 +88,7 @@ func newJoinOptions() *types.JoinOptions {
return opts
}
-//Add2EdgeToolsList Reads the flagData (containing val and default val) and join options to fill the list of tools.
+// Add2EdgeToolsList Reads the flagData (containing val and default val) and join options to fill the list of tools.
func Add2EdgeToolsList(toolList map[string]types.ToolsInstaller, flagData map[string]types.FlagData, joinOptions *types.JoinOptions) error {
var kubeVer string
diff --git a/keadm/cmd/keadm/app/cmd/util/exec.go b/keadm/cmd/keadm/app/cmd/util/exec.go
index c91537c6a..718a2e648 100644
--- a/keadm/cmd/keadm/app/cmd/util/exec.go
+++ b/keadm/cmd/keadm/app/cmd/util/exec.go
@@ -9,7 +9,7 @@ import (
"syscall"
)
-//Command defines commands to be executed and captures std out and std error
+// Command defines commands to be executed and captures std out and std error
type Command struct {
Cmd *exec.Cmd
StdOut []byte
diff --git a/keadm/cmd/keadm/app/cmd/util/k8sinstaller.go b/keadm/cmd/keadm/app/cmd/util/k8sinstaller.go
index 0640824b8..329b16f09 100644
--- a/keadm/cmd/keadm/app/cmd/util/k8sinstaller.go
+++ b/keadm/cmd/keadm/app/cmd/util/k8sinstaller.go
@@ -35,15 +35,15 @@ import (
"github.com/kubeedge/kubeedge/common/constants"
)
-//K8SInstTool embeds Common struct and contains the default K8S version and
-//a flag depicting if host is an edge or cloud node
-//It implements ToolsInstaller interface
+// K8SInstTool embeds Common struct and contains the default K8S version and
+// a flag depicting if host is an edge or cloud node
+// It implements ToolsInstaller interface
type K8SInstTool struct {
Common
}
-//InstallTools sets the OS interface, checks if K8S installation is required or not.
-//If required then install the said version.
+// InstallTools sets the OS interface, checks if K8S installation is required or not.
+// If required then install the said version.
func (ks *K8SInstTool) InstallTools() error {
ks.SetOSInterface(GetOSInterface())
@@ -198,8 +198,8 @@ func createKubeEdgeV1CRD(dynamicClient dynamic.Interface, crdFile string) error
return err
}
-//TearDown should uninstall K8S, but it is not required either for cloud or edge node.
-//It is defined so that K8SInstTool implements ToolsInstaller interface
+// TearDown should uninstall K8S, but it is not required either for cloud or edge node.
+// It is defined so that K8SInstTool implements ToolsInstaller interface
func (ks *K8SInstTool) TearDown() error {
return nil
}
diff --git a/keadm/cmd/keadm/app/cmd/util/mqttinstaller.go b/keadm/cmd/keadm/app/cmd/util/mqttinstaller.go
index 3b6f80dea..efc009c83 100644
--- a/keadm/cmd/keadm/app/cmd/util/mqttinstaller.go
+++ b/keadm/cmd/keadm/app/cmd/util/mqttinstaller.go
@@ -16,12 +16,12 @@ limitations under the License.
package util
-//MQTTInstTool embeds Common struct and It implements ToolsInstaller interface
+// MQTTInstTool embeds Common struct and It implements ToolsInstaller interface
type MQTTInstTool struct {
Common
}
-//InstallTools sets the OS interface, it simply installs the said version
+// InstallTools sets the OS interface, it simply installs the said version
func (m *MQTTInstTool) InstallTools() error {
m.SetOSInterface(GetOSInterface())
err := m.InstallMQTT()
@@ -31,8 +31,8 @@ func (m *MQTTInstTool) InstallTools() error {
return nil
}
-//TearDown should uninstall MQTT, but it is not required either for cloud or edge node.
-//It is defined so that MQTTInstTool implements ToolsInstaller interface
+// TearDown should uninstall MQTT, but it is not required either for cloud or edge node.
+// It is defined so that MQTTInstTool implements ToolsInstaller interface
func (m *MQTTInstTool) TearDown() error {
return nil
}
diff --git a/keadm/cmd/keadm/app/keadm.go b/keadm/cmd/keadm/app/keadm.go
index cf61b40f1..54e2d49b4 100644
--- a/keadm/cmd/keadm/app/keadm.go
+++ b/keadm/cmd/keadm/app/keadm.go
@@ -24,7 +24,7 @@ import (
"github.com/kubeedge/kubeedge/keadm/cmd/keadm/app/cmd"
)
-//Run executes the keadm command
+// Run executes the keadm command
func Run() error {
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)