image prune: support removing external containers

Support removing external containers (e.g., build containers) during
image prune.

Fixes: #11472
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-09-24 14:39:36 +02:00
parent 340166876e
commit a9a54eefab
26 changed files with 208 additions and 70 deletions

View File

@@ -83,12 +83,12 @@ func (s *supplementedImageReference) NewImageSource(ctx context.Context, sys *ty
if iss != nil {
// The composite source has been created. Use its Close method.
if err2 := iss.Close(); err2 != nil {
logrus.Errorf("error opening image: %v", err2)
logrus.Errorf("Opening image: %v", err2)
}
} else if top != nil {
// The composite source has not been created, but the top was already opened. Close it.
if err2 := top.Close(); err2 != nil {
logrus.Errorf("error opening image: %v", err2)
logrus.Errorf("Closing image: %v", err2)
}
}
}