diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-13 13:35:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 13:35:10 +0200 |
commit | d88d74639fbabfd83663ea94a11c11c7a54b781b (patch) | |
tree | 7c11ae7b8a0f8fe59e7e29ebeca6e5a43424d69f /pkg/domain/infra | |
parent | c0dd0d696e333ad42a5fa3d9428fee27b1c30061 (diff) | |
parent | 07a8eb829563df9215d86eed7b3337c14dadb6cc (diff) | |
download | podman-d88d74639fbabfd83663ea94a11c11c7a54b781b.tar.gz podman-d88d74639fbabfd83663ea94a11c11c7a54b781b.tar.bz2 podman-d88d74639fbabfd83663ea94a11c11c7a54b781b.zip |
Merge pull request #15753 from mheon/fix_15720
Ensure that the DF endpoint updated volume refcount
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/system.go | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 3389abd88..da903df9e 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -11,7 +11,6 @@ import ( "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" - cutil "github.com/containers/common/pkg/util" "github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/domain/entities/reports" @@ -321,19 +320,9 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.System return nil, err } - running, err := ic.Libpod.GetRunningContainers() - if err != nil { - return nil, err - } - runningContainers := make([]string, 0, len(running)) - for _, c := range running { - runningContainers = append(runningContainers, c.ID()) - } - dfVolumes := make([]*entities.SystemDfVolumeReport, 0, len(vols)) for _, v := range vols { var reclaimableSize uint64 - var consInUse int mountPoint, err := v.MountPoint() if err != nil { return nil, err @@ -355,14 +344,9 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.System if len(inUse) == 0 { reclaimableSize = volSize } - for _, viu := range inUse { - if cutil.StringInSlice(viu, runningContainers) { - consInUse++ - } - } report := entities.SystemDfVolumeReport{ VolumeName: v.Name(), - Links: consInUse, + Links: len(inUse), Size: int64(volSize), ReclaimableSize: int64(reclaimableSize), } |