summaryrefslogtreecommitdiff
path: root/pkg/bindings/manifests/manifests.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-04-29 10:51:02 -0400
committerQi Wang <qiwan@redhat.com>2020-05-05 15:01:32 -0400
commit1090d4d5d99410b5433330516a4ea3f5e5a27375 (patch)
tree1dde472b1b5b5cf8b6b48dca84bd289a3e581618 /pkg/bindings/manifests/manifests.go
parentfb6eca50ba9e2dc652da0c33c72db70ab9da85e9 (diff)
downloadpodman-1090d4d5d99410b5433330516a4ea3f5e5a27375.tar.gz
podman-1090d4d5d99410b5433330516a4ea3f5e5a27375.tar.bz2
podman-1090d4d5d99410b5433330516a4ea3f5e5a27375.zip
manifest annotate
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'pkg/bindings/manifests/manifests.go')
-rw-r--r--pkg/bindings/manifests/manifests.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go
index a8d1e6ca3..b85169410 100644
--- a/pkg/bindings/manifests/manifests.go
+++ b/pkg/bindings/manifests/manifests.go
@@ -124,3 +124,24 @@ func Push(ctx context.Context, name string, destination *string, all *bool) (str
}
return idr.ID, response.Process(&idr)
}
+
+// Annotate updates the image configuration of a given manifest list
+func Annotate(ctx context.Context, name, digest string, options image.ManifestAnnotateOpts) (string, error) {
+ var idr handlers.IDResponse
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return "", err
+ }
+ params := url.Values{}
+ params.Set("digest", digest)
+ optionsString, err := jsoniter.MarshalToString(options)
+ if err != nil {
+ return "", err
+ }
+ stringReader := strings.NewReader(optionsString)
+ response, err := conn.DoRequest(stringReader, http.MethodPost, "/manifests/%s/annotate", params, name)
+ if err != nil {
+ return "", err
+ }
+ return idr.ID, response.Process(&idr)
+}