summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-27 16:25:30 +0100
committerGitHub <noreply@github.com>2020-03-27 16:25:30 +0100
commit4233250c430a8f769048548b6ad6affd0d9e65e0 (patch)
tree0cf0c3dc86ccf85be3d5098f278021798c3f6b6c /libpod
parent3ddb5b10d53df54346a6d795047124fc4e995699 (diff)
parente56d5295614b745115abf0198f7b67ae157aae1e (diff)
downloadpodman-4233250c430a8f769048548b6ad6affd0d9e65e0.tar.gz
podman-4233250c430a8f769048548b6ad6affd0d9e65e0.tar.bz2
podman-4233250c430a8f769048548b6ad6affd0d9e65e0.zip
Merge pull request #5611 from baude/v2podcreate
podmanv2 pod create using podspecgen
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_volume.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/libpod/runtime_volume.go b/libpod/runtime_volume.go
index d522ffb6c..d5fede1d1 100644
--- a/libpod/runtime_volume.go
+++ b/libpod/runtime_volume.go
@@ -5,7 +5,6 @@ import (
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/libpod/events"
- "github.com/containers/libpod/pkg/domain/entities"
"github.com/pkg/errors"
)
@@ -130,10 +129,8 @@ func (r *Runtime) GetAllVolumes() ([]*Volume, error) {
}
// PruneVolumes removes unused volumes from the system
-func (r *Runtime) PruneVolumes(ctx context.Context) ([]*entities.VolumePruneReport, error) {
- var (
- reports []*entities.VolumePruneReport
- )
+func (r *Runtime) PruneVolumes(ctx context.Context) (map[string]error, error) {
+ reports := make(map[string]error)
vols, err := r.GetAllVolumes()
if err != nil {
return nil, err
@@ -142,12 +139,12 @@ func (r *Runtime) PruneVolumes(ctx context.Context) ([]*entities.VolumePruneRepo
for _, vol := range vols {
if err := r.RemoveVolume(ctx, vol, false); err != nil {
if errors.Cause(err) != define.ErrVolumeBeingUsed && errors.Cause(err) != define.ErrVolumeRemoved {
- reports = append(reports, &entities.VolumePruneReport{Id: vol.Name(), Err: err})
+ reports[vol.Name()] = err
}
continue
}
vol.newVolumeEvent(events.Prune)
- reports = append(reports, &entities.VolumePruneReport{Id: vol.Name()})
+ reports[vol.Name()] = nil
}
return reports, nil
}