From baf3a9b3a72e4d98ad30ee56a7dd81812fb1fd21 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Fri, 20 Mar 2020 13:00:37 -0500 Subject: use boolreport for containerexists response in the case of exists, use a boolreport structure so that responses can be consistent pointer and error Signed-off-by: Brent Baude --- pkg/domain/infra/abi/containers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/domain/infra/abi/containers.go') diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 618e9a111..2332c2874 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -12,12 +12,12 @@ import ( ) // TODO: Should return *entities.ContainerExistsReport, error -func (ic *ContainerEngine) ContainerExists(ctx context.Context, nameOrId string) (bool, error) { +func (ic *ContainerEngine) ContainerExists(ctx context.Context, nameOrId string) (*entities.BoolReport, error) { _, err := ic.Libpod.LookupContainer(nameOrId) if err != nil && errors.Cause(err) != define.ErrNoSuchCtr { - return false, err + return nil, err } - return err == nil, nil + return &entities.BoolReport{Value: err == nil}, nil } func (ic *ContainerEngine) ContainerWait(ctx context.Context, namesOrIds []string, options entities.WaitOptions) ([]entities.WaitReport, error) { -- cgit v1.2.3-54-g00ecf