Update the entire cAdvisor package. There is a version mismatch issue

which cause #707
This commit is contained in:
Dawn Chen 2014-07-30 16:56:50 -07:00
parent 76ec7acf91
commit 2e8020be8c
3 changed files with 19 additions and 17 deletions

View File

@ -62,7 +62,6 @@ func testHTTPContainerInfoGetter(
// So changing req after Get*Info would be a race. // So changing req after Get*Info would be a race.
expectedReq := req expectedReq := req
// Fill any empty fields with default value // Fill any empty fields with default value
expectedReq = expectedReq.FillDefaults()
if !reflect.DeepEqual(expectedReq, &receivedReq) { if !reflect.DeepEqual(expectedReq, &receivedReq) {
t.Errorf("received wrong request") t.Errorf("received wrong request")
} }
@ -110,10 +109,11 @@ func testHTTPContainerInfoGetter(
func TestHTTPContainerInfoGetterGetContainerInfoSuccessfully(t *testing.T) { func TestHTTPContainerInfoGetterGetContainerInfoSuccessfully(t *testing.T) {
req := &info.ContainerInfoRequest{ req := &info.ContainerInfoRequest{
NumStats: 10, NumStats: 10,
NumSamples: 10, NumSamples: 10,
CpuUsagePercentiles: []int{20, 30},
MemoryUsagePercentiles: []int{40, 50},
} }
req = req.FillDefaults()
cinfo := itest.GenerateRandomContainerInfo( cinfo := itest.GenerateRandomContainerInfo(
"dockerIDWhichWillNotBeChecked", // docker ID "dockerIDWhichWillNotBeChecked", // docker ID
2, // Number of cores 2, // Number of cores
@ -125,10 +125,11 @@ func TestHTTPContainerInfoGetterGetContainerInfoSuccessfully(t *testing.T) {
func TestHTTPContainerInfoGetterGetRootInfoSuccessfully(t *testing.T) { func TestHTTPContainerInfoGetterGetRootInfoSuccessfully(t *testing.T) {
req := &info.ContainerInfoRequest{ req := &info.ContainerInfoRequest{
NumStats: 10, NumStats: 10,
NumSamples: 10, NumSamples: 10,
CpuUsagePercentiles: []int{20, 30},
MemoryUsagePercentiles: []int{40, 50},
} }
req = req.FillDefaults()
cinfo := itest.GenerateRandomContainerInfo( cinfo := itest.GenerateRandomContainerInfo(
"dockerIDWhichWillNotBeChecked", // docker ID "dockerIDWhichWillNotBeChecked", // docker ID
2, // Number of cores 2, // Number of cores
@ -140,10 +141,11 @@ func TestHTTPContainerInfoGetterGetRootInfoSuccessfully(t *testing.T) {
func TestHTTPContainerInfoGetterGetContainerInfoWithError(t *testing.T) { func TestHTTPContainerInfoGetterGetContainerInfoWithError(t *testing.T) {
req := &info.ContainerInfoRequest{ req := &info.ContainerInfoRequest{
NumStats: 10, NumStats: 10,
NumSamples: 10, NumSamples: 10,
CpuUsagePercentiles: []int{20, 30},
MemoryUsagePercentiles: []int{40, 50},
} }
req = req.FillDefaults()
cinfo := itest.GenerateRandomContainerInfo( cinfo := itest.GenerateRandomContainerInfo(
"dockerIDWhichWillNotBeChecked", // docker ID "dockerIDWhichWillNotBeChecked", // docker ID
2, // Number of cores 2, // Number of cores
@ -155,10 +157,11 @@ func TestHTTPContainerInfoGetterGetContainerInfoWithError(t *testing.T) {
func TestHTTPContainerInfoGetterGetRootInfoWithError(t *testing.T) { func TestHTTPContainerInfoGetterGetRootInfoWithError(t *testing.T) {
req := &info.ContainerInfoRequest{ req := &info.ContainerInfoRequest{
NumStats: 10, NumStats: 10,
NumSamples: 10, NumSamples: 10,
CpuUsagePercentiles: []int{20, 30},
MemoryUsagePercentiles: []int{40, 50},
} }
req = req.FillDefaults()
cinfo := itest.GenerateRandomContainerInfo( cinfo := itest.GenerateRandomContainerInfo(
"dockerIDWhichWillNotBeChecked", // docker ID "dockerIDWhichWillNotBeChecked", // docker ID
2, // Number of cores 2, // Number of cores

View File

@ -289,7 +289,7 @@ func (kl *Kubelet) runContainer(pod *Pod, container *api.Container, podVolumes v
ExposedPorts: exposedPorts, ExposedPorts: exposedPorts,
Hostname: container.Name, Hostname: container.Name,
Image: container.Image, Image: container.Image,
Memory: uint64(container.Memory), Memory: int64(container.Memory),
CpuShares: int64(milliCPUToShares(container.CPU)), CpuShares: int64(milliCPUToShares(container.CPU)),
Volumes: volumes, Volumes: volumes,
WorkingDir: container.WorkingDir, WorkingDir: container.WorkingDir,
@ -545,7 +545,7 @@ func getCadvisorContainerInfoRequest(req *info.ContainerInfoRequest) *info.Conta
ret := &info.ContainerInfoRequest{ ret := &info.ContainerInfoRequest{
NumStats: req.NumStats, NumStats: req.NumStats,
CpuUsagePercentiles: req.CpuUsagePercentiles, CpuUsagePercentiles: req.CpuUsagePercentiles,
MemoryUsagePercentages: req.MemoryUsagePercentages, MemoryUsagePercentiles: req.MemoryUsagePercentiles,
} }
return ret return ret
} }

3
third_party/deps.sh vendored
View File

@ -5,8 +5,7 @@ TOP_PACKAGES="
code.google.com/p/goauth2/compute/serviceaccount code.google.com/p/goauth2/compute/serviceaccount
code.google.com/p/goauth2/oauth code.google.com/p/goauth2/oauth
code.google.com/p/google-api-go-client/compute/v1 code.google.com/p/google-api-go-client/compute/v1
github.com/google/cadvisor/info github.com/google/cadvisor
github.com/google/cadvisor/client
" "
DEP_PACKAGES=" DEP_PACKAGES="