mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +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)
|
||||
v.eventGen.Add(events...)
|
||||
|
||||
if v.needsReports(request, policyContext.NewResource(), v.admissionReports) {
|
||||
if err := v.createReports(ctx, policyContext.NewResource(), request, engineResponses...); err != nil {
|
||||
v.log.Error(err, "failed to create report")
|
||||
go func() {
|
||||
if v.needsReports(request, policyContext.NewResource(), v.admissionReports) {
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue