From 26644d7cb85d5935bb59c7891ac9a81d6092673c Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Sun, 29 Mar 2020 18:21:44 -0500 Subject: podman v2 image tag and untag add the ability to tag and untag images in podmanv2 Signed-off-by: Brent Baude --- pkg/bindings/images/images.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pkg/bindings/images/images.go') 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 -- cgit v1.2.3-54-g00ecf