mirror of
https://github.com/kyverno/kyverno.git
synced 2025-01-20 18:52:16 +00:00
6d48a185d1
* skip invalid policy files Signed-off-by: Jim Bugwadia <jim@nirmata.com> * fix file-system policy loader Signed-off-by: Jim Bugwadia <jim@nirmata.com> * propagate policy schema error Signed-off-by: Jim Bugwadia <jim@nirmata.com> --------- Signed-off-by: Jim Bugwadia <jim@nirmata.com>
16 lines
355 B
Go
16 lines
355 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
|
|
}
|