kubeeye/cmd/audit.go

29 lines
554 B
Go
Raw Normal View History

package cmd
import (
2020-11-28 16:43:33 +08:00
"flag"
"fmt"
"github.com/spf13/cobra"
2020-11-28 16:43:33 +08:00
"github.com/spf13/pflag"
"kubeye/pkg/validator"
)
2020-11-25 20:45:05 +08:00
var config string
var auditCmd = &cobra.Command{
Use: "audit",
Short: "audit the result",
Run: func(cmd *cobra.Command, args []string) {
2020-11-25 20:45:05 +08:00
err := validator.Cluster(config, cmd.Context())
if err != nil {
fmt.Println(err)
}
},
}
2020-11-28 16:43:33 +08:00
func init() {
rootCmd.AddCommand(auditCmd)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
auditCmd.Flags().StringVarP(&config, "filename", "f", "", "Customize best practice configuration")
}