Make sure that image events are written *after* execution.

Fixes: #10812
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-06-30 11:32:48 +02:00
parent 0d8d805a76
commit 8b52204baa
12 changed files with 79 additions and 31 deletions

View File

@ -65,7 +65,7 @@ func (r *Runtime) Push(ctx context.Context, source, destination string, options
}
if r.eventChannel != nil {
r.writeEvent(&Event{ID: image.ID(), Name: destination, Time: time.Now(), Type: EventTypeImagePush})
defer r.writeEvent(&Event{ID: image.ID(), Name: destination, Time: time.Now(), Type: EventTypeImagePush})
}
// Buildah compat: Make sure to tag the destination image if it's a