mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
fix: isolate report creation context for mutate in admission (#11304)
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
This commit is contained in:
parent
339bc1eab2
commit
53922941d6
1 changed files with 6 additions and 4 deletions
|
@ -155,11 +155,13 @@ func (v *mutationHandler) applyMutations(
|
||||||
events := webhookutils.GenerateEvents(engineResponses, false, cfg)
|
events := webhookutils.GenerateEvents(engineResponses, false, cfg)
|
||||||
v.eventGen.Add(events...)
|
v.eventGen.Add(events...)
|
||||||
|
|
||||||
if v.needsReports(request, policyContext.NewResource(), v.admissionReports) {
|
go func() {
|
||||||
if err := v.createReports(ctx, policyContext.NewResource(), request, engineResponses...); err != nil {
|
if v.needsReports(request, policyContext.NewResource(), v.admissionReports) {
|
||||||
v.log.Error(err, "failed to create report")
|
if err := v.createReports(context.TODO(), policyContext.NewResource(), request, engineResponses...); err != nil {
|
||||||
|
v.log.Error(err, "failed to create report")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}()
|
||||||
|
|
||||||
logMutationResponse(patches, engineResponses, v.log)
|
logMutationResponse(patches, engineResponses, v.log)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue