1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

fixed triggring generate rule (#1355)

This commit is contained in:
Pooja Singh 2020-12-03 23:13:43 +05:30 committed by GitHub
parent 673b3bfd22
commit 733cd060a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,7 +104,7 @@ type WebhookServer struct {
auditHandler AuditHandler
log logr.Logger
log logr.Logger
openAPIController *openapi.Controller
@ -179,7 +179,7 @@ func NewWebhookServer(
log: log,
openAPIController: openAPIController,
supportMutateValidate: supportMutateValidate,
resCache: resCache,
resCache: resCache,
}
mux := httprouter.New()
@ -347,7 +347,9 @@ func (ws *WebhookServer) ResourceMutation(request *v1beta1.AdmissionRequest) *v1
// GENERATE
if request.Operation == v1beta1.Create || request.Operation == v1beta1.Update {
go ws.HandleGenerate(request.DeepCopy(), generatePolicies, ctx, userRequestInfo, ws.configHandler)
newRequest := request.DeepCopy()
newRequest.Object.Raw = patchedResource
go ws.HandleGenerate(newRequest, generatePolicies, ctx, userRequestInfo, ws.configHandler)
}
patchType := v1beta1.PatchTypeJSONPatch