1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 01:46:55 +00:00
kyverno/cmd/cli/kubectl-kyverno/jp/jp.go
Charles-Edouard Brétéché b28c16fe99
refactor: split CLI jp command (#5566)
* refactor: split CLI jp command

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

* fix sonatype comments

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>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-12-21 06:06:13 +00:00

29 lines
782 B
Go

package jp
import (
"strings"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/jp/function"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/jp/parse"
"github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/jp/query"
"github.com/spf13/cobra"
)
var description = []string{
"Provides a command-line interface to JMESPath, enhanced with Kyverno specific custom functions",
"For more information visit: https://kyverno.io/docs/writing-policies/jmespath/ ",
}
func Command() *cobra.Command {
cmd := &cobra.Command{
Use: "jp",
Short: strings.Join(description, "\n"),
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
cmd.AddCommand(query.Command())
cmd.AddCommand(function.Command())
cmd.AddCommand(parse.Command())
return cmd
}