2022-07-03 21:49:16 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
2023-02-08 14:53:59 +00:00
|
|
|
|
|
|
|
"github.com/kyverno/policy-reporter/cmd/send"
|
2022-07-03 21:49:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func newSendCMD() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "send",
|
|
|
|
Short: "Send different kinds of email reports",
|
|
|
|
}
|
|
|
|
|
|
|
|
// For local usage
|
|
|
|
cmd.PersistentFlags().StringP("kubeconfig", "k", "", "absolute path to the kubeconfig file")
|
|
|
|
cmd.PersistentFlags().StringP("config", "c", "", "target configuration file")
|
|
|
|
cmd.PersistentFlags().StringP("template-dir", "t", "./templates", "template directory for email reports")
|
|
|
|
cmd.AddCommand(send.NewSummaryCMD())
|
|
|
|
cmd.AddCommand(send.NewViolationsCMD())
|
|
|
|
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
return cmd
|
|
|
|
}
|