Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag completion for ks install command #207

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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