Skip to content

Commit 9b6ec44

Browse files
committed
libpod/container_internal.go: util.SizeOfPath -> directory.Size
- Remove deprecated util.SizeOfPath Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
1 parent 0f7f74c commit 9b6ec44

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

libpod/container_internal.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import (
5050
cutil "go.podman.io/common/pkg/util"
5151
"go.podman.io/storage"
5252
"go.podman.io/storage/pkg/chrootarchive"
53+
"go.podman.io/storage/pkg/directory"
5354
"go.podman.io/storage/pkg/fileutils"
5455
"go.podman.io/storage/pkg/idmap"
5556
"go.podman.io/storage/pkg/idtools"
@@ -100,8 +101,8 @@ func (c *Container) rootFsSize() (int64, error) {
100101
// for a given container.
101102
func (c *Container) rwSize() (int64, error) {
102103
if c.config.Rootfs != "" {
103-
size, err := util.SizeOfPath(c.config.Rootfs)
104-
return int64(size), err
104+
size, err := directory.Size(c.config.Rootfs)
105+
return size, err
105106
}
106107

107108
layerSize, err := c.runtime.store.ContainerSize(c.ID())

pkg/util/utils.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"github.com/opencontainers/runtime-spec/specs-go"
2626
"github.com/sirupsen/logrus"
2727
"go.podman.io/image/v5/types"
28-
"go.podman.io/storage/pkg/directory"
2928
"go.podman.io/storage/pkg/fileutils"
3029
"go.podman.io/storage/pkg/idtools"
3130
"go.podman.io/storage/pkg/unshare"
@@ -1198,15 +1197,6 @@ func LookupUser(name string) (*user.User, error) {
11981197
return user.Lookup(name)
11991198
}
12001199

1201-
// SizeOfPath determines the file usage of a given path. it was called volumeSize in v1
1202-
// and now is made to be generic and take a path instead of a libpod volume
1203-
//
1204-
// Deprecated: use github.com/containers/storage/pkg/directory.Size() instead.
1205-
func SizeOfPath(path string) (uint64, error) {
1206-
size, err := directory.Size(path)
1207-
return uint64(size), err
1208-
}
1209-
12101200
// ParseRestartPolicy parses the value given to the --restart flag and returns the policy
12111201
// and restart retries value
12121202
func ParseRestartPolicy(policy string) (string, uint, error) {

0 commit comments

Comments
 (0)