1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/cmd/cli/kubectl-kyverno/commands/command.go
Charles-Edouard Brétéché cad231fc15
feat: add resource migration command (#9296)
* feat: add resource migration command

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

* finalize PR

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

* fix unit tests

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

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-01-19 11:47:28 +00:00

43 lines
1.3 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/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(),
migrate.Command(),
test.Command(),
version.Command(),
)
if experimental {
cmd.AddCommand(
fix.Command(),
oci.Command(),
)
}
return cmd
}