From be5605ac4f0a9765c11bbd52ef0a658d2439b372 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 22 Apr 2020 15:29:47 -0700 Subject: V2 Restore rmi tests * Introduced define.ErrImageInUse to assist in determining the exit code without resorting string searches. Signed-off-by: Jhon Honce --- pkg/domain/infra/abi/images.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/domain/infra') diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index d0b7b42b5..caed432f9 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -466,7 +466,7 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie }() // deleteImage is an anonymous function to conveniently delete an image - // withouth having to pass all local data around. + // without having to pass all local data around. deleteImage := func(img *image.Image) error { results, err := ir.Libpod.RemoveImage(ctx, img, opts.Force) switch errors.Cause(err) { @@ -476,6 +476,9 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie inUseErrors = true // Important for exit codes in Podman. return errors.New( fmt.Sprintf("A container associated with containers/storage, i.e. via Buildah, CRI-O, etc., may be associated with this image: %-12.12s\n", img.ID())) + case define.ErrImageInUse: + inUseErrors = true + return err default: otherErrors = true // Important for exit codes in Podman. return err -- cgit v1.2.3-54-g00ecf