From 884a6389c6d67d49644f9cfe5e69175b8b929ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Wed, 16 Oct 2024 09:41:20 +0200 Subject: [PATCH] fix: use autogen v2 in exceptions controller (#11397) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- pkg/controllers/exceptions/controller.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/exceptions/controller.go b/pkg/controllers/exceptions/controller.go index cfd7f2eb88..1c73969690 100644 --- a/pkg/controllers/exceptions/controller.go +++ b/pkg/controllers/exceptions/controller.go @@ -10,7 +10,7 @@ import ( "github.com/go-logr/logr" kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1" kyvernov2 "github.com/kyverno/kyverno/api/kyverno/v2" - "github.com/kyverno/kyverno/pkg/autogen" + "github.com/kyverno/kyverno/pkg/autogenv2" kyvernov1informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1" kyvernov2informers "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v2" kyvernov1listers "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1" @@ -155,10 +155,10 @@ func (c *controller) buildRuleIndex(key string, policy kyvernov1.PolicyInterface return 0 }) index := ruleIndex{} - for _, rule := range autogen.ComputeRules(policy, "") { + for _, name := range autogenv2.GetAutogenRuleNames(policy) { for _, polex := range polexList { - if polex.Contains(key, rule.Name) { - index[rule.Name] = append(index[rule.Name], polex) + if polex.Contains(key, name) { + index[name] = append(index[name], polex) } } }