Use VirtualSize of the docker image as the image size
This commit is contained in:
@@ -55,6 +55,6 @@ func toRuntimeImage(image *docker.APIImages) (*kubecontainer.Image, error) {
|
|||||||
return &kubecontainer.Image{
|
return &kubecontainer.Image{
|
||||||
ID: image.ID,
|
ID: image.ID,
|
||||||
Tags: image.RepoTags,
|
Tags: image.RepoTags,
|
||||||
Size: image.Size,
|
Size: image.VirtualSize,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
@@ -51,9 +51,9 @@ func TestToRuntimeContainer(t *testing.T) {
|
|||||||
|
|
||||||
func TestToRuntimeImage(t *testing.T) {
|
func TestToRuntimeImage(t *testing.T) {
|
||||||
original := &docker.APIImages{
|
original := &docker.APIImages{
|
||||||
ID: "aeeea",
|
ID: "aeeea",
|
||||||
RepoTags: []string{"abc", "def"},
|
RepoTags: []string{"abc", "def"},
|
||||||
Size: 1234,
|
VirtualSize: 1234,
|
||||||
}
|
}
|
||||||
expected := &kubecontainer.Image{
|
expected := &kubecontainer.Image{
|
||||||
ID: "aeeea",
|
ID: "aeeea",
|
||||||
|
@@ -1173,7 +1173,7 @@ func (kl *Kubelet) SyncPods(allPods []*api.Pod, podSyncTypes map[types.UID]metri
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note that we just killed the unwanted pods. This may not have reflected
|
// Note that we just killed the unwanted pods. This may not have reflected
|
||||||
// in the cache. We need to bypass the cach to get the latest set of
|
// in the cache. We need to bypass the cache to get the latest set of
|
||||||
// running pods to clean up the volumes.
|
// running pods to clean up the volumes.
|
||||||
// TODO: Evaluate the performance impact of bypassing the runtime cache.
|
// TODO: Evaluate the performance impact of bypassing the runtime cache.
|
||||||
runningPods, err = kl.containerRuntime.GetPods(false)
|
runningPods, err = kl.containerRuntime.GetPods(false)
|
||||||
|
Reference in New Issue
Block a user