summaryrefslogtreecommitdiff
path: root/pkg/bindings/manifests/manifests.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-01-22 14:09:55 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-01-22 20:19:13 +0100
commit6e6a38b4168ed7a528614f6499783243a8668395 (patch)
tree4389f13d6407233e77c84d3557f63bc0fdbc51b2 /pkg/bindings/manifests/manifests.go
parentf02aba659447ea9198851231d7f11a8bfdfe69ba (diff)
downloadpodman-6e6a38b4168ed7a528614f6499783243a8668395.tar.gz
podman-6e6a38b4168ed7a528614f6499783243a8668395.tar.bz2
podman-6e6a38b4168ed7a528614f6499783243a8668395.zip
podman manifest exists
Add podman manifest exists command with remote support. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/bindings/manifests/manifests.go')
-rw-r--r--pkg/bindings/manifests/manifests.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go
index b6db64b02..fec9832a0 100644
--- a/pkg/bindings/manifests/manifests.go
+++ b/pkg/bindings/manifests/manifests.go
@@ -49,6 +49,19 @@ func Create(ctx context.Context, names, images []string, options *CreateOptions)
return idr.ID, response.Process(&idr)
}
+// Exists returns true if a given maifest list exists
+func Exists(ctx context.Context, name string, options *ExistsOptions) (bool, error) {
+ conn, err := bindings.GetClient(ctx)
+ if err != nil {
+ return false, err
+ }
+ response, err := conn.DoRequest(nil, http.MethodGet, "/manifests/%s/exists", nil, nil, name)
+ if err != nil {
+ return false, err
+ }
+ return response.IsSuccess(), nil
+}
+
// Inspect returns a manifest list for a given name.
func Inspect(ctx context.Context, name string, options *InspectOptions) (*manifest.Schema2List, error) {
var list manifest.Schema2List