mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix: load policies (#8403)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: kyverno-bot <104836976+kyverno-bot@users.noreply.github.com>
This commit is contained in:
parent
d5c23f0f45
commit
5181deaf2e
1 changed files with 3 additions and 1 deletions
|
@ -70,8 +70,10 @@ func addPolicy(policies []kyvernov1.PolicyInterface, validatingAdmissionPolicies
|
|||
var policy kyvernov1.PolicyInterface
|
||||
if us.GetKind() == "ClusterPolicy" {
|
||||
policy = &kyvernov1.ClusterPolicy{}
|
||||
} else {
|
||||
} else if us.GetKind() == "Policy" {
|
||||
policy = &kyvernov1.Policy{}
|
||||
} else {
|
||||
return policies, validatingAdmissionPolicies, nil
|
||||
}
|
||||
|
||||
if err := runtime.DefaultUnstructuredConverter.FromUnstructuredWithValidation(us.Object, policy, true); err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue