Use VirtualSize of the docker image as the image size

This commit is contained in:
Yu-Ju Hong
2015-05-11 10:50:14 -07:00
parent 3599d81ef1
commit a9c9505206
3 changed files with 5 additions and 5 deletions

View File

@@ -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
} }

View File

@@ -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",

View File

@@ -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)