1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/cmd/cli/kubectl-kyverno/main.go
Charles-Edouard Brétéché cef4a9b546
refactor: move all cli commands in a commands package (#8231)
* chore: name all cli command files the same

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: move all cli commands in a commands package

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* root

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-09-04 15:15:55 +00:00

28 lines
547 B
Go

package main
import (
"flag"
"fmt"
"os"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands"
"github.com/kyverno/kyverno/pkg/logging"
"github.com/spf13/cobra"
)
func main() {
cmd := commands.RootCommand()
configureLogs(cmd)
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}
func configureLogs(cli *cobra.Command) {
logging.InitFlags(nil)
if err := logging.Setup(logging.TextFormat, 0); err != nil {
fmt.Println("failed to setup logging", err)
os.Exit(1)
}
cli.PersistentFlags().AddGoFlagSet(flag.CommandLine)
}