Skip to content

Commit

Permalink
libimage: untag events on image removal
Browse files Browse the repository at this point in the history
As reported in containers/podman/issues/15485, Docker sends untag events
prior to removing the image.  Follow that example for compatibility
reasons.

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Aug 26, 2022
1 parent 72a7da3 commit b759c1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libimage/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,11 @@ func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveIma
}
return processedIDs, err
}

report.Untagged = append(report.Untagged, i.Names()...)
for _, name := range i.Names() {
i.runtime.writeEvent(&Event{ID: i.ID(), Name: name, Time: time.Now(), Type: EventTypeImageUntag})
}

if !hasChildren {
report.Removed = true
Expand Down

0 comments on commit b759c1a

Please sign in to comment.