summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/pods.go
blob: de22de68ebf6274499868be386fd6c0c135206a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
}