summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/pods.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain/infra/abi/pods.go')
-rw-r--r--pkg/domain/infra/abi/pods.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go
new file mode 100644
index 000000000..de22de68e
--- /dev/null
+++ b/pkg/domain/infra/abi/pods.go
@@ -0,0 +1,19 @@
+// +build ABISupport
+
+package abi
+
+import (
+ "context"
+ "github.com/pkg/errors"
+
+ "github.com/containers/libpod/libpod/define"
+ "github.com/containers/libpod/pkg/domain/entities"
+)
+
+func (ic *ContainerEngine) PodExists(ctx context.Context, nameOrId string) (*entities.BoolReport, error) {
+ _, err := ic.Libpod.LookupPod(nameOrId)
+ if err != nil && errors.Cause(err) != define.ErrNoSuchPod {
+ return nil, err
+ }
+ return &entities.BoolReport{Value: err == nil}, nil
+}