diff options
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/volumes.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/volumes.go b/pkg/domain/infra/abi/volumes.go index 823605052..f15aa2d14 100644 --- a/pkg/domain/infra/abi/volumes.go +++ b/pkg/domain/infra/abi/volumes.go @@ -153,3 +153,12 @@ func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeL } return reports, nil } + +// VolumeExists check if a given volume name exists +func (ic *ContainerEngine) VolumeExists(ctx context.Context, nameOrID string) (*entities.BoolReport, error) { + exists, err := ic.Libpod.HasVolume(nameOrID) + if err != nil { + return nil, err + } + return &entities.BoolReport{Value: exists}, nil +} |