summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-21 14:29:30 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-24 16:03:49 -0500
commitae614920bfe2510ca6d1dd6cea02bbe17ddb245c (patch)
tree5edd6e5fd01f12154c82146ce6170aaf7d716e19 /pkg/bindings
parent0c084d9719772a9b68d5eb67114cf5bf001958b2 (diff)
downloadpodman-ae614920bfe2510ca6d1dd6cea02bbe17ddb245c.tar.gz
podman-ae614920bfe2510ca6d1dd6cea02bbe17ddb245c.tar.bz2
podman-ae614920bfe2510ca6d1dd6cea02bbe17ddb245c.zip
podmanv2 volumes
add volume commands: create, inspect, ls, prune, and rm Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/volumes/volumes.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/pkg/bindings/volumes/volumes.go b/pkg/bindings/volumes/volumes.go
index a2164e0af..cef9246cb 100644
--- a/pkg/bindings/volumes/volumes.go
+++ b/pkg/bindings/volumes/volumes.go
@@ -7,7 +7,6 @@ import (
"strconv"
"strings"
- "github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/bindings"
"github.com/containers/libpod/pkg/domain/entities"
jsoniter "github.com/json-iterator/go"
@@ -35,9 +34,9 @@ func Create(ctx context.Context, config entities.VolumeCreateOptions) (*entities
}
// Inspect returns low-level information about a volume.
-func Inspect(ctx context.Context, nameOrID string) (*libpod.InspectVolumeData, error) {
+func Inspect(ctx context.Context, nameOrID string) (*entities.VolumeConfigResponse, error) {
var (
- inspect libpod.InspectVolumeData
+ inspect entities.VolumeConfigResponse
)
conn, err := bindings.GetClient(ctx)
if err != nil {
@@ -52,9 +51,9 @@ func Inspect(ctx context.Context, nameOrID string) (*libpod.InspectVolumeData, e
// List returns the configurations for existing volumes in the form of a slice. Optionally, filters
// can be used to refine the list of volumes.
-func List(ctx context.Context, filters map[string][]string) ([]*libpod.VolumeConfig, error) {
+func List(ctx context.Context, filters map[string][]string) ([]*entities.VolumeListReport, error) {
var (
- vols []*libpod.VolumeConfig
+ vols []*entities.VolumeListReport
)
conn, err := bindings.GetClient(ctx)
if err != nil {
@@ -76,9 +75,9 @@ func List(ctx context.Context, filters map[string][]string) ([]*libpod.VolumeCon
}
// Prune removes unused volumes from the local filesystem.
-func Prune(ctx context.Context) ([]string, error) {
+func Prune(ctx context.Context) ([]*entities.VolumePruneReport, error) {
var (
- pruned []string
+ pruned []*entities.VolumePruneReport
)
conn, err := bindings.GetClient(ctx)
if err != nil {
@@ -86,7 +85,7 @@ func Prune(ctx context.Context) ([]string, error) {
}
response, err := conn.DoRequest(nil, http.MethodPost, "/volumes/prune", nil)
if err != nil {
- return pruned, err
+ return nil, err
}
return pruned, response.Process(&pruned)
}