diff options
author | Sascha Grunert <sgrunert@suse.com> | 2019-12-16 13:28:16 +0100 |
---|---|---|
committer | Sascha Grunert <sgrunert@suse.com> | 2020-01-08 10:06:10 +0100 |
commit | 40b74e02b77e83c377fdae83f626f83403b38152 (patch) | |
tree | c71e9d5c4cd1c1517006368c151b81c4ea5d4077 /pkg/varlinkapi | |
parent | c41fd09a8da3a96bc0e58f9f29f87b9bdf30264d (diff) | |
download | podman-40b74e02b77e83c377fdae83f626f83403b38152.tar.gz podman-40b74e02b77e83c377fdae83f626f83403b38152.tar.bz2 podman-40b74e02b77e83c377fdae83f626f83403b38152.zip |
Add `untag` sub-command
Podman now supports untagging images via the `untag` sub-command for the
root and `image` commands. Testing and documentation has been added as
well.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/images.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index ac92343d0..bc644f87c 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -450,6 +450,18 @@ func (i *LibpodAPI) TagImage(call iopodman.VarlinkCall, name, tag string) error return call.ReplyTagImage(newImage.ID()) } +// UntagImage accepts an image name and tag as strings and removes the tag from the local store. +func (i *LibpodAPI) UntagImage(call iopodman.VarlinkCall, name, tag string) error { + newImage, err := i.Runtime.ImageRuntime().NewFromLocal(name) + if err != nil { + return call.ReplyImageNotFound(name, err.Error()) + } + if err := newImage.UntagImage(tag); err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + return call.ReplyUntagImage(newImage.ID()) +} + // RemoveImage accepts a image name or ID as a string and force bool to determine if it should // remove the image even if being used by stopped containers func (i *LibpodAPI) RemoveImage(call iopodman.VarlinkCall, name string, force bool) error { |