diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-01-19 23:03:51 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-01-21 19:18:51 +0100 |
commit | 9d31fed5f75186f618e95ab7492ef6bc2b511d5f (patch) | |
tree | 11215b0dd70351b4157fd19a17c65d4fcfca77ed /pkg/domain/infra/tunnel/volumes.go | |
parent | 7d024a2fc8c675e4d34e3b34b56b6217a48ef9ce (diff) | |
download | podman-9d31fed5f75186f618e95ab7492ef6bc2b511d5f.tar.gz podman-9d31fed5f75186f618e95ab7492ef6bc2b511d5f.tar.bz2 podman-9d31fed5f75186f618e95ab7492ef6bc2b511d5f.zip |
podman volume exists
Add podman volume exists command with remote support.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/domain/infra/tunnel/volumes.go')
-rw-r--r-- | pkg/domain/infra/tunnel/volumes.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/domain/infra/tunnel/volumes.go b/pkg/domain/infra/tunnel/volumes.go index f21336828..ffd2c1d35 100644 --- a/pkg/domain/infra/tunnel/volumes.go +++ b/pkg/domain/infra/tunnel/volumes.go @@ -80,3 +80,14 @@ func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeL options := new(volumes.ListOptions).WithFilters(opts.Filter) return volumes.List(ic.ClientCtx, options) } + +// VolumeExists checks if the given volume exists +func (ic *ContainerEngine) VolumeExists(ctx context.Context, nameOrID string) (*entities.BoolReport, error) { + exists, err := volumes.Exists(ic.ClientCtx, nameOrID, nil) + if err != nil { + return nil, err + } + return &entities.BoolReport{ + Value: exists, + }, nil +} |