mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
fix: delete k3s cluster with kubenetes version
fix issue: https://github.com/kubesphere/kubekey/issues/1148 let below cmd works ``` ./kk delete cluster --with-kubenetes v1.21.6-k3s ``` Signed-off-by: Deshi Xiao <xiaods@gmail.com>
This commit is contained in:
parent
691611a4c0
commit
ab7b07c1df
|
|
@ -27,6 +27,7 @@ import (
|
|||
type DeleteClusterOptions struct {
|
||||
CommonOptions *options.CommonOptions
|
||||
ClusterCfgFile string
|
||||
Kubernetes string
|
||||
}
|
||||
|
||||
func NewDeleteClusterOptions() *DeleteClusterOptions {
|
||||
|
|
@ -53,12 +54,14 @@ func NewCmdDeleteCluster() *cobra.Command {
|
|||
|
||||
func (o *DeleteClusterOptions) Run() error {
|
||||
arg := common.Argument{
|
||||
FilePath: o.ClusterCfgFile,
|
||||
Debug: o.CommonOptions.Verbose,
|
||||
FilePath: o.ClusterCfgFile,
|
||||
Debug: o.CommonOptions.Verbose,
|
||||
KubernetesVersion: o.Kubernetes,
|
||||
}
|
||||
return pipelines.DeleteCluster(arg)
|
||||
}
|
||||
|
||||
func (o *DeleteClusterOptions) AddFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().StringVarP(&o.ClusterCfgFile, "filename", "f", "", "Path to a configuration file")
|
||||
cmd.Flags().StringVarP(&o.Kubernetes, "with-kubernetes", "", "", "Specify a supported version of kubernetes")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue