1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/cmd/cli/kubectl-kyverno/commands/command.go
Charles-Edouard Brétéché 8a0d2a598a
feat: add root command to process generic json resources (#9639)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-05 12:38:01 +00:00

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
}