1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00

fix: stop mutating cached resource in ur controller (#4003) (#4006)

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
Prateek Pandey 2022-05-24 16:09:51 +05:30 committed by GitHub
parent 78e7c5dc18
commit 07e1afaa61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,6 @@ import (
"github.com/kyverno/kyverno/pkg/config" "github.com/kyverno/kyverno/pkg/config"
dclient "github.com/kyverno/kyverno/pkg/dclient" dclient "github.com/kyverno/kyverno/pkg/dclient"
"github.com/kyverno/kyverno/pkg/event" "github.com/kyverno/kyverno/pkg/event"
admissionv1 "k8s.io/api/admission/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/runtime"
@ -239,7 +238,6 @@ func (c *controller) updatePolicy(old, cur interface{}) {
// re-evaluate the UR as the policy was updated // re-evaluate the UR as the policy was updated
for _, ur := range urs { for _, ur := range urs {
ur.Spec.Context.AdmissionRequestInfo.Operation = admissionv1.Update
c.enqueueUpdateRequest(ur) c.enqueueUpdateRequest(ur)
} }
} }