mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
8a0d2a598a
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package commands
|
|
|
|
import (
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/command"
|
|
"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/json"
|
|
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/commands/migrate"
|
|
"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/spf13/cobra"
|
|
)
|
|
|
|
func RootCommand(experimental bool) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "kyverno",
|
|
Short: command.FormatDescription(true, websiteUrl, false, description...),
|
|
Long: command.FormatDescription(false, websiteUrl, false, description...),
|
|
SilenceUsage: true,
|
|
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
return cmd.Help()
|
|
},
|
|
}
|
|
cmd.AddCommand(
|
|
apply.Command(),
|
|
create.Command(),
|
|
docs.Command(cmd),
|
|
jp.Command(),
|
|
json.Command(),
|
|
migrate.Command(),
|
|
test.Command(),
|
|
version.Command(),
|
|
)
|
|
if experimental {
|
|
cmd.AddCommand(
|
|
fix.Command(),
|
|
oci.Command(),
|
|
)
|
|
}
|
|
return cmd
|
|
}
|