2020-11-08 02:43:58 +08:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/pflag"
|
|
|
|
"kubeye/pkg/validator"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(auditCmd)
|
|
|
|
flag.Parse()
|
|
|
|
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
|
|
|
|
}
|
|
|
|
|
|
|
|
var auditCmd = &cobra.Command{
|
|
|
|
Use: "audit",
|
|
|
|
Short: "audit the result",
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2020-11-20 18:57:02 +08:00
|
|
|
err := validator.Cluster(cmd.Context())
|
2020-11-08 02:43:58 +08:00
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|