From 2e8020be8ce32670ebffbff814758fa33e3cac9a Mon Sep 17 00:00:00 2001 From: Dawn Chen Date: Wed, 30 Jul 2014 16:56:50 -0700 Subject: [PATCH] Update the entire cAdvisor package. There is a version mismatch issue which cause #707 --- pkg/client/containerinfo_test.go | 29 ++++++++++++++++------------- pkg/kubelet/kubelet.go | 4 ++-- third_party/deps.sh | 3 +-- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/pkg/client/containerinfo_test.go b/pkg/client/containerinfo_test.go index 4d4a04543b291..9a31b3ec19d14 100644 --- a/pkg/client/containerinfo_test.go +++ b/pkg/client/containerinfo_test.go @@ -62,7 +62,6 @@ func testHTTPContainerInfoGetter( // So changing req after Get*Info would be a race. expectedReq := req // Fill any empty fields with default value - expectedReq = expectedReq.FillDefaults() if !reflect.DeepEqual(expectedReq, &receivedReq) { t.Errorf("received wrong request") } @@ -110,10 +109,11 @@ func testHTTPContainerInfoGetter( func TestHTTPContainerInfoGetterGetContainerInfoSuccessfully(t *testing.T) { req := &info.ContainerInfoRequest{ - NumStats: 10, - NumSamples: 10, + NumStats: 10, + NumSamples: 10, + CpuUsagePercentiles: []int{20, 30}, + MemoryUsagePercentiles: []int{40, 50}, } - req = req.FillDefaults() cinfo := itest.GenerateRandomContainerInfo( "dockerIDWhichWillNotBeChecked", // docker ID 2, // Number of cores @@ -125,10 +125,11 @@ func TestHTTPContainerInfoGetterGetContainerInfoSuccessfully(t *testing.T) { func TestHTTPContainerInfoGetterGetRootInfoSuccessfully(t *testing.T) { req := &info.ContainerInfoRequest{ - NumStats: 10, - NumSamples: 10, + NumStats: 10, + NumSamples: 10, + CpuUsagePercentiles: []int{20, 30}, + MemoryUsagePercentiles: []int{40, 50}, } - req = req.FillDefaults() cinfo := itest.GenerateRandomContainerInfo( "dockerIDWhichWillNotBeChecked", // docker ID 2, // Number of cores @@ -140,10 +141,11 @@ func TestHTTPContainerInfoGetterGetRootInfoSuccessfully(t *testing.T) { func TestHTTPContainerInfoGetterGetContainerInfoWithError(t *testing.T) { req := &info.ContainerInfoRequest{ - NumStats: 10, - NumSamples: 10, + NumStats: 10, + NumSamples: 10, + CpuUsagePercentiles: []int{20, 30}, + MemoryUsagePercentiles: []int{40, 50}, } - req = req.FillDefaults() cinfo := itest.GenerateRandomContainerInfo( "dockerIDWhichWillNotBeChecked", // docker ID 2, // Number of cores @@ -155,10 +157,11 @@ func TestHTTPContainerInfoGetterGetContainerInfoWithError(t *testing.T) { func TestHTTPContainerInfoGetterGetRootInfoWithError(t *testing.T) { req := &info.ContainerInfoRequest{ - NumStats: 10, - NumSamples: 10, + NumStats: 10, + NumSamples: 10, + CpuUsagePercentiles: []int{20, 30}, + MemoryUsagePercentiles: []int{40, 50}, } - req = req.FillDefaults() cinfo := itest.GenerateRandomContainerInfo( "dockerIDWhichWillNotBeChecked", // docker ID 2, // Number of cores diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index a756b8a1b954b..70bd76f2f70f4 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -289,7 +289,7 @@ func (kl *Kubelet) runContainer(pod *Pod, container *api.Container, podVolumes v ExposedPorts: exposedPorts, Hostname: container.Name, Image: container.Image, - Memory: uint64(container.Memory), + Memory: int64(container.Memory), CpuShares: int64(milliCPUToShares(container.CPU)), Volumes: volumes, WorkingDir: container.WorkingDir, @@ -545,7 +545,7 @@ func getCadvisorContainerInfoRequest(req *info.ContainerInfoRequest) *info.Conta ret := &info.ContainerInfoRequest{ NumStats: req.NumStats, CpuUsagePercentiles: req.CpuUsagePercentiles, - MemoryUsagePercentages: req.MemoryUsagePercentages, + MemoryUsagePercentiles: req.MemoryUsagePercentiles, } return ret } diff --git a/third_party/deps.sh b/third_party/deps.sh index a94467e1e7954..05e7b6a74366d 100755 --- a/third_party/deps.sh +++ b/third_party/deps.sh @@ -5,8 +5,7 @@ TOP_PACKAGES=" code.google.com/p/goauth2/compute/serviceaccount code.google.com/p/goauth2/oauth code.google.com/p/google-api-go-client/compute/v1 - github.com/google/cadvisor/info - github.com/google/cadvisor/client + github.com/google/cadvisor " DEP_PACKAGES="