libpod/container_internal.go: util.SizeOfPath -> directory.Size

- Remove deprecated util.SizeOfPath

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar
2025-11-10 09:33:59 -05:00
parent f11392c719
commit 96aba07d95
2 changed files with 3 additions and 12 deletions

View File

@@ -50,6 +50,7 @@ import (
cutil "go.podman.io/common/pkg/util"
"go.podman.io/storage"
"go.podman.io/storage/pkg/chrootarchive"
"go.podman.io/storage/pkg/directory"
"go.podman.io/storage/pkg/fileutils"
"go.podman.io/storage/pkg/idmap"
"go.podman.io/storage/pkg/idtools"
@@ -100,8 +101,8 @@ func (c *Container) rootFsSize() (int64, error) {
// for a given container.
func (c *Container) rwSize() (int64, error) {
if c.config.Rootfs != "" {
size, err := util.SizeOfPath(c.config.Rootfs)
return int64(size), err
size, err := directory.Size(c.config.Rootfs)
return size, err
}
layerSize, err := c.runtime.store.ContainerSize(c.ID())

View File

@@ -25,7 +25,6 @@ import (
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
"go.podman.io/image/v5/types"
"go.podman.io/storage/pkg/directory"
"go.podman.io/storage/pkg/fileutils"
"go.podman.io/storage/pkg/idtools"
"go.podman.io/storage/pkg/unshare"
@@ -1200,15 +1199,6 @@ func LookupUser(name string) (*user.User, error) {
return user.Lookup(name)
}
// SizeOfPath determines the file usage of a given path. it was called volumeSize in v1
// and now is made to be generic and take a path instead of a libpod volume
//
// Deprecated: use github.com/containers/storage/pkg/directory.Size() instead.
func SizeOfPath(path string) (uint64, error) {
size, err := directory.Size(path)
return uint64(size), err
}
// ParseRestartPolicy parses the value given to the --restart flag and returns the policy
// and restart retries value
func ParseRestartPolicy(policy string) (string, uint, error) {