mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 15:37:19 +00:00
* refactor: introduce cli variables package Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * lint Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * refactor: move utils cobra to command package Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
41 lines
1.3 KiB
Go
41 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/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/experimental"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func RootCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "kyverno",
|
|
Short: command.FormatDescription(true, websiteUrl, false, description...),
|
|
Long: command.FormatDescription(false, websiteUrl, false, description...),
|
|
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
|
|
}
|