summaryrefslogtreecommitdiff
path: root/pkg/bindings/images/images.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-29 18:21:44 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-31 19:36:26 -0500
commit26644d7cb85d5935bb59c7891ac9a81d6092673c (patch)
tree5220c5eb01357e4dbc0c635b81d4623c3a5438ed /pkg/bindings/images/images.go
parent6d36d05447fd594bedebea8a9a4366d348a78290 (diff)
downloadpodman-26644d7cb85d5935bb59c7891ac9a81d6092673c.tar.gz
podman-26644d7cb85d5935bb59c7891ac9a81d6092673c.tar.bz2
podman-26644d7cb85d5935bb59c7891ac9a81d6092673c.zip
podman v2 image tag and untag
add the ability to tag and untag images in podmanv2 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/images/images.go')
-rw-r--r--pkg/bindings/images/images.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index 5f5c4443f..9ef85b955 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -197,6 +197,22 @@ func Tag(ctx context.Context, nameOrID, tag, repo string) error {
return response.Process(nil)
}
+// Untag removes a name from locally-stored image. Both the tag and repo parameters are required.
+func Untag(ctx context.Context, nameOrID, tag, repo string) error {
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return err
+ }
+ params := url.Values{}
+ params.Set("tag", tag)
+ params.Set("repo", repo)
+ response, err := conn.DoRequest(nil, http.MethodPost, "/images/%s/untag", params, nameOrID)
+ if err != nil {
+ return err
+ }
+ return response.Process(nil)
+}
+
func Build(nameOrId string) {}
// Imports adds the given image to the local image store. This can be done by file and the given reader