1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

Merge pull request #1151 from NoSkillGirl/bug/validate_apiversion_change

fixed yaml package for CLI validate
This commit is contained in:
Pooja Singh 2020-10-01 18:34:48 +05:30 committed by GitHub
commit 2f9d77f6d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,8 @@ import (
_ "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation"
yamlv2 "gopkg.in/yaml.v2"
log "sigs.k8s.io/controller-runtime/pkg/log"
yaml "sigs.k8s.io/yaml"
)
func Command() *cobra.Command {
@ -82,7 +82,7 @@ func Command() *cobra.Command {
return err
}
if outputType == "yaml" {
yamlPolicy, _ := yamlv2.Marshal(p)
yamlPolicy, _ := yaml.Marshal(p)
fmt.Println(string(yamlPolicy))
} else {
jsonPolicy, _ := json.MarshalIndent(p, "", " ")