Skip to content

Commit

Permalink
Add flag completion for ks install command (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Sep 24, 2021
1 parent 4d78233 commit bdbf7c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kubectl-plugin/install/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ You can get more details about the ks-installer from https://github.com/kubesphe
"The nightly version you want to install")
flags.StringArrayVarP(&opt.components, "components", "", []string{},
"The components that you want to Enabled with KubeSphere")

_ = cmd.RegisterFlagCompletionFunc("components", common.PluginAbleComponentsCompletion())
return
}

Expand Down
1 change: 1 addition & 0 deletions kubectl-plugin/install/k3d.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ You can get more details from https://github.com/rancher/k3d/`,
_ = cmd.RegisterFlagCompletionFunc("image", common.ArrayCompletion("rancher/k3s:v1.19.14-k3s1",
"rancher/k3s:v1.20.10-k3s1",
"rancher/k3s:v1.21.4-k3s1"))
_ = cmd.RegisterFlagCompletionFunc("components", common.PluginAbleComponentsCompletion())
return
}

Expand Down
2 changes: 1 addition & 1 deletion kubectl-plugin/install/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ks install kind --nightly latest --components DevOps`,
flags.BoolVarP(&opt.fetch, "fetch", "", true,
"Indicate if fetch the latest config of tools")

_ = cmd.RegisterFlagCompletionFunc("components", common.ArrayCompletion("DevOps"))
_ = cmd.RegisterFlagCompletionFunc("components", common.PluginAbleComponentsCompletion())
return
}

Expand Down
3 changes: 3 additions & 0 deletions kubectl-plugin/install/kk.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ ks install kk --version nightly --components devops`,
"Indicate the container runtime type. Supported: docker, containerd")
flags.BoolVarP(&opt.fetch, "fetch", "", true,
"Indicate if fetch the latest config of tools")

_ = cmd.RegisterFlagCompletionFunc("components", common.PluginAbleComponentsCompletion())
_ = cmd.RegisterFlagCompletionFunc("components", common.ArrayCompletion("docker", "containerd"))
return
}

Expand Down

0 comments on commit bdbf7c7

Please sign in to comment.