aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/manifest.go
diff options
context:
space:
mode:
authorToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-07-26 09:56:24 +0900
committerToshiki Sonoda <sonoda.toshiki@fujitsu.com>2022-07-27 10:33:15 +0900
commit8628c01f5e085335afc5ef3b4a019d09d2147858 (patch)
tree835c7d1da4f6fbf6aa0a0f17e45e13979c2c8576 /pkg/domain/infra/abi/manifest.go
parentda1f47921685f40f1b26405278cbf9cb2d06fe09 (diff)
downloadpodman-8628c01f5e085335afc5ef3b4a019d09d2147858.tar.gz
podman-8628c01f5e085335afc5ef3b4a019d09d2147858.tar.bz2
podman-8628c01f5e085335afc5ef3b4a019d09d2147858.zip
Fix: manifest push --rm removes a correct manifest list
This bug is reproduced when we execute the following command: 1. podman manifest add <manifest list> <images exist on local storage> 2. podman manifest push --rm <manifest list> dir:<directory> If pushing succeeds, it is expected to remove only a manifest list. However, manifest list remains on local storage and images are removed. This commit fixes `podman manifest push --rm` to remove only a manifest list. And, supports `manifest push --rm option` in remote environment, like host environment. Fixes: https://github.com/containers/podman/issues/15033 Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Diffstat (limited to 'pkg/domain/infra/abi/manifest.go')
-rw-r--r--pkg/domain/infra/abi/manifest.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go
index d20744d76..bdc3d9513 100644
--- a/pkg/domain/infra/abi/manifest.go
+++ b/pkg/domain/infra/abi/manifest.go
@@ -331,7 +331,8 @@ func (ir *ImageEngine) ManifestPush(ctx context.Context, name, destination strin
}
if opts.Rm {
- if _, rmErrors := ir.Libpod.LibimageRuntime().RemoveImages(ctx, []string{manifestList.ID()}, nil); len(rmErrors) > 0 {
+ rmOpts := &libimage.RemoveImagesOptions{LookupManifest: true}
+ if _, rmErrors := ir.Libpod.LibimageRuntime().RemoveImages(ctx, []string{manifestList.ID()}, rmOpts); len(rmErrors) > 0 {
return "", fmt.Errorf("error removing manifest after push: %w", rmErrors[0])
}
}