diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-06 03:41:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 03:41:09 +0200 |
commit | 7885b5cd52e77d16b846f0d6b981995df6072166 (patch) | |
tree | 435988cc38b931c0538ee45a7eaf3434a24ca681 /pkg/bindings/manifests/manifests.go | |
parent | 864aec8bb011a7a42cf0a2faca39f6e27118b805 (diff) | |
parent | 1090d4d5d99410b5433330516a4ea3f5e5a27375 (diff) | |
download | podman-7885b5cd52e77d16b846f0d6b981995df6072166.tar.gz podman-7885b5cd52e77d16b846f0d6b981995df6072166.tar.bz2 podman-7885b5cd52e77d16b846f0d6b981995df6072166.zip |
Merge pull request #6063 from QiWang19/manifest-annotate
manifest annotate
Diffstat (limited to 'pkg/bindings/manifests/manifests.go')
-rw-r--r-- | pkg/bindings/manifests/manifests.go | 21 |
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) +} |