mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
fix systemcontext to use correct TMPDIR
Users are complaining about read/only /var/tmp failing even if TMPDIR=/tmp is set. This PR Fixes: https://github.com/containers/podman/issues/10698 [NO TESTS NEEDED] No way to test this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
16
vendor/github.com/containers/common/libimage/image.go
generated
vendored
16
vendor/github.com/containers/common/libimage/image.go
generated
vendored
@ -329,17 +329,19 @@ func (i *Image) remove(ctx context.Context, rmMap map[string]*RemoveImageReport,
|
||||
// an `rmi foo` will not untag "foo" but instead attempt to remove the
|
||||
// entire image. If there's a container using "foo", we should get an
|
||||
// error.
|
||||
if options.Force || referencedBy == "" || numNames == 1 {
|
||||
if referencedBy == "" || numNames == 1 {
|
||||
// DO NOTHING, the image will be removed
|
||||
} else {
|
||||
byID := strings.HasPrefix(i.ID(), referencedBy)
|
||||
byDigest := strings.HasPrefix(referencedBy, "sha256:")
|
||||
if byID && numNames > 1 {
|
||||
return errors.Errorf("unable to delete image %q by ID with more than one tag (%s): please force removal", i.ID(), i.Names())
|
||||
} else if byDigest && numNames > 1 {
|
||||
// FIXME - Docker will remove the digest but containers storage
|
||||
// does not support that yet, so our hands are tied.
|
||||
return errors.Errorf("unable to delete image %q by digest with more than one tag (%s): please force removal", i.ID(), i.Names())
|
||||
if !options.Force {
|
||||
if byID && numNames > 1 {
|
||||
return errors.Errorf("unable to delete image %q by ID with more than one tag (%s): please force removal", i.ID(), i.Names())
|
||||
} else if byDigest && numNames > 1 {
|
||||
// FIXME - Docker will remove the digest but containers storage
|
||||
// does not support that yet, so our hands are tied.
|
||||
return errors.Errorf("unable to delete image %q by digest with more than one tag (%s): please force removal", i.ID(), i.Names())
|
||||
}
|
||||
}
|
||||
|
||||
// Only try to untag if we know it's not an ID or digest.
|
||||
|
Reference in New Issue
Block a user