From a9c95052067e55a590bf73b3bf50577c198b2b83 Mon Sep 17 00:00:00 2001 From: Yu-Ju Hong Date: Mon, 11 May 2015 10:50:14 -0700 Subject: [PATCH] Use VirtualSize of the docker image as the image size --- pkg/kubelet/dockertools/convert.go | 2 +- pkg/kubelet/dockertools/convert_test.go | 6 +++--- pkg/kubelet/kubelet.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/kubelet/dockertools/convert.go b/pkg/kubelet/dockertools/convert.go index 31498ed6814..31fe5aa7c63 100644 --- a/pkg/kubelet/dockertools/convert.go +++ b/pkg/kubelet/dockertools/convert.go @@ -55,6 +55,6 @@ func toRuntimeImage(image *docker.APIImages) (*kubecontainer.Image, error) { return &kubecontainer.Image{ ID: image.ID, Tags: image.RepoTags, - Size: image.Size, + Size: image.VirtualSize, }, nil } diff --git a/pkg/kubelet/dockertools/convert_test.go b/pkg/kubelet/dockertools/convert_test.go index 6cac463a30f..7afa56d9fe1 100644 --- a/pkg/kubelet/dockertools/convert_test.go +++ b/pkg/kubelet/dockertools/convert_test.go @@ -51,9 +51,9 @@ func TestToRuntimeContainer(t *testing.T) { func TestToRuntimeImage(t *testing.T) { original := &docker.APIImages{ - ID: "aeeea", - RepoTags: []string{"abc", "def"}, - Size: 1234, + ID: "aeeea", + RepoTags: []string{"abc", "def"}, + VirtualSize: 1234, } expected := &kubecontainer.Image{ ID: "aeeea", diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index c1d75c3de42..b2d65585003 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -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 - // 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. // TODO: Evaluate the performance impact of bypassing the runtime cache. runningPods, err = kl.containerRuntime.GetPods(false)