mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
* 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>
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package commands
|
|
|
|
import (
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/apply"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/create"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/docs"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/fix"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/jp"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/oci"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/test"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/version"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/experimental"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func RootCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "kyverno",
|
|
Long: "To enable experimental commands, KYVERNO_EXPERIMENTAL should be configured with true or 1.",
|
|
Short: "Kubernetes Native Policy Management",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return cmd.Help()
|
|
},
|
|
}
|
|
cmd.AddCommand(
|
|
apply.Command(),
|
|
create.Command(),
|
|
docs.Command(cmd),
|
|
jp.Command(),
|
|
test.Command(),
|
|
version.Command(),
|
|
)
|
|
if experimental.IsExperimentalEnabled() {
|
|
cmd.AddCommand(
|
|
fix.Command(),
|
|
oci.Command(),
|
|
)
|
|
}
|
|
return cmd
|
|
}
|