Skip to content

Commit

Permalink
Update the entire cAdvisor package. There is a version mismatch issue
Browse files Browse the repository at this point in the history
which cause kubernetes#707
  • Loading branch information
dchen1107 committed Jul 31, 2014
1 parent 76ec7ac commit 2e8020b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
29 changes: 16 additions & 13 deletions pkg/client/containerinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions third_party/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down

0 comments on commit 2e8020b

Please sign in to comment.