diff options
Diffstat (limited to 'pkg/domain/infra/tunnel/volumes.go')
-rw-r--r-- | pkg/domain/infra/tunnel/volumes.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pkg/domain/infra/tunnel/volumes.go b/pkg/domain/infra/tunnel/volumes.go index c0df2bb7b..10e8d7da8 100644 --- a/pkg/domain/infra/tunnel/volumes.go +++ b/pkg/domain/infra/tunnel/volumes.go @@ -5,11 +5,12 @@ import ( "github.com/containers/podman/v2/pkg/bindings/volumes" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities/reports" "github.com/pkg/errors" ) func (ic *ContainerEngine) VolumeCreate(ctx context.Context, opts entities.VolumeCreateOptions) (*entities.IDOrNameResponse, error) { - response, err := volumes.Create(ic.ClientCxt, opts) + response, err := volumes.Create(ic.ClientCtx, opts, nil) if err != nil { return nil, err } @@ -18,7 +19,7 @@ func (ic *ContainerEngine) VolumeCreate(ctx context.Context, opts entities.Volum func (ic *ContainerEngine) VolumeRm(ctx context.Context, namesOrIds []string, opts entities.VolumeRmOptions) ([]*entities.VolumeRmReport, error) { if opts.All { - vols, err := volumes.List(ic.ClientCxt, nil) + vols, err := volumes.List(ic.ClientCtx, nil) if err != nil { return nil, err } @@ -28,8 +29,9 @@ func (ic *ContainerEngine) VolumeRm(ctx context.Context, namesOrIds []string, op } reports := make([]*entities.VolumeRmReport, 0, len(namesOrIds)) for _, id := range namesOrIds { + options := new(volumes.RemoveOptions).WithForce(opts.Force) reports = append(reports, &entities.VolumeRmReport{ - Err: volumes.Remove(ic.ClientCxt, id, &opts.Force), + Err: volumes.Remove(ic.ClientCtx, id, options), Id: id, }) } @@ -42,7 +44,7 @@ func (ic *ContainerEngine) VolumeInspect(ctx context.Context, namesOrIds []strin errs = []error{} ) if opts.All { - vols, err := volumes.List(ic.ClientCxt, nil) + vols, err := volumes.List(ic.ClientCtx, nil) if err != nil { return nil, nil, err } @@ -51,7 +53,7 @@ func (ic *ContainerEngine) VolumeInspect(ctx context.Context, namesOrIds []strin } } for _, id := range namesOrIds { - data, err := volumes.Inspect(ic.ClientCxt, id) + data, err := volumes.Inspect(ic.ClientCtx, id, nil) if err != nil { errModel, ok := err.(entities.ErrorModel) if !ok { @@ -68,10 +70,12 @@ func (ic *ContainerEngine) VolumeInspect(ctx context.Context, namesOrIds []strin return reports, errs, nil } -func (ic *ContainerEngine) VolumePrune(ctx context.Context) ([]*entities.VolumePruneReport, error) { - return volumes.Prune(ic.ClientCxt) +func (ic *ContainerEngine) VolumePrune(ctx context.Context, opts entities.VolumePruneOptions) ([]*reports.PruneReport, error) { + options := new(volumes.PruneOptions).WithFilters(opts.Filters) + return volumes.Prune(ic.ClientCtx, options) } func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeListOptions) ([]*entities.VolumeListReport, error) { - return volumes.List(ic.ClientCxt, opts.Filter) + options := new(volumes.ListOptions).WithFilters(opts.Filter) + return volumes.List(ic.ClientCtx, options) } |