mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
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:
@@ -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())
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user