mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-15 08:46:36 +00:00
chore: simplify getting exception name (#9916)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
ae1ab5d848
commit
ad62014b33
1 changed files with 1 additions and 6 deletions
|
@ -1,8 +1,6 @@
|
|||
package engine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
||||
kyvernov2beta1 "github.com/kyverno/kyverno/api/kyverno/v2beta1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
|
@ -22,10 +20,7 @@ func (e *engine) GetPolicyExceptions(
|
|||
if err != nil {
|
||||
return exceptions, err
|
||||
}
|
||||
policyName, err := cache.MetaNamespaceKeyFunc(policy)
|
||||
if err != nil {
|
||||
return exceptions, fmt.Errorf("failed to compute policy key: %w", err)
|
||||
}
|
||||
policyName := cache.MetaObjectToName(policy).String()
|
||||
for _, polex := range polexs {
|
||||
if polex.Contains(policyName, rule) {
|
||||
exceptions = append(exceptions, *polex)
|
||||
|
|
Loading…
Add table
Reference in a new issue