diff options
author | baude <bbaude@redhat.com> | 2018-02-27 12:25:25 -0600 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-08 19:31:31 +0000 |
commit | bb6f0f8e266a77852c2690d1ee956ecbf23d28ff (patch) | |
tree | fbb6a14c5c22766b3912f5dd1272700fbc4cef71 /libpod/runtime_img.go | |
parent | 54f32f2cc024090c3f284f7b0b6832f2b19a6660 (diff) | |
download | podman-bb6f0f8e266a77852c2690d1ee956ecbf23d28ff.tar.gz podman-bb6f0f8e266a77852c2690d1ee956ecbf23d28ff.tar.bz2 podman-bb6f0f8e266a77852c2690d1ee956ecbf23d28ff.zip |
Image Resolution Stage 1
This is the stage 1 effort for an image library that can be eventually used by buildah and
podman alike. In eventuality, the main goal of the library (package) is to:
* provide a consistent approach to resolving image names in various forms (from users).
* based on the result of the above, provide image methods that in a singular spot but separate from the runtime.
* reduce the cruft and bloat in the current podman runtime.
The goal of stage 1 is to demonstrate fast, accurate image resolution for both local and remote images resulting in
an image object as part of the return.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #463
Approved by: baude
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r-- | libpod/runtime_img.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go index bc328d5b9..8d2c3a1d6 100644 --- a/libpod/runtime_img.go +++ b/libpod/runtime_img.go @@ -884,9 +884,11 @@ func (r *Runtime) RemoveImage(image *storage.Image, force bool) (string, error) if len(image.Names) > 1 && !force { return "", fmt.Errorf("unable to delete %s (must force) - image is referred to in multiple tags", image.ID) } - // If it is forced, we have to untag the image so that it can be deleted - image.Names = image.Names[:0] + // If it is forced, we have to untag the image so that it can be deleted + if err = r.store.SetNames(image.ID, image.Names[:0]); err != nil { + return "", err + } _, err = r.store.DeleteImage(image.ID, true) if err != nil { return "", err |