1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-07 00:17:13 +00:00
kyverno/cmd/cli/kubectl-kyverno/policy/legacy_loader.go
Charles-Edouard Brétéché 4e84edff68
feat: add support for loading validating policies in the cli (#11883)
* feat: add support for loading validating policies in the cli

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

* copy data

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

* legacy loader

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

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2025-01-10 10:43:48 +00:00

15 lines
357 B
Go

package policy
import yamlutils "github.com/kyverno/kyverno/pkg/utils/yaml"
func legacyLoader(_ string, content []byte) (*LoaderResults, error) {
policies, vaps, bindings, _, err := yamlutils.GetPolicy(content)
if err != nil {
return nil, err
}
return &LoaderResults{
Policies: policies,
VAPs: vaps,
VAPBindings: bindings,
}, nil
}