mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
30 lines
665 B
Go
30 lines
665 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/pixiake/kubekey/pkg/reset"
|
|
"github.com/pixiake/kubekey/pkg/util"
|
|
log "github.com/sirupsen/logrus"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func NewCmdResetCluster() *cobra.Command {
|
|
var (
|
|
clusterCfgFile string
|
|
)
|
|
var clusterCmd = &cobra.Command{
|
|
Use: "reset",
|
|
Short: "Reset Kubernetes Cluster",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
logger := util.InitLogger(true)
|
|
resetCluster(clusterCfgFile, logger)
|
|
},
|
|
}
|
|
|
|
clusterCmd.Flags().StringVarP(&clusterCfgFile, "config", "f", "", "")
|
|
return clusterCmd
|
|
}
|
|
|
|
func resetCluster(clusterCfgFile string, logger *log.Logger) {
|
|
reset.ResetCluster(clusterCfgFile, logger)
|
|
}
|