Merge pull request #49102 from aleksandra-malinowska/kubemark-node-provider-id

Automatic merge from submit-queue (batch tested with PRs 46094, 48544, 48807, 49102, 44174)

add InstanceID to fake cadvisor (used in Kubemark)

This change is for setting Node.Spec.ProviderID field in Kubemark hollow nodes. It shouldn't affect other tests using cadvisor.Fake as field is nil by default.

cc @gmarek
pull/6/head
Kubernetes Submit Queue 2017-07-18 11:20:57 -07:00 committed by GitHub
commit bc2e5381e9
2 changed files with 5 additions and 1 deletions

View File

@ -112,7 +112,9 @@ func main() {
}
if config.Morph == "kubelet" {
cadvisorInterface := new(cadvisortest.Fake)
cadvisorInterface := &cadvisortest.Fake{
NodeName: config.NodeName,
}
containerManager := cm.NewStubContainerManager()
fakeDockerClient := libdocker.NewFakeDockerClient().WithTraceDisabled()
fakeDockerClient.EnableSleep = true

View File

@ -25,6 +25,7 @@ import (
// Fake cAdvisor implementation.
type Fake struct {
NodeName string
}
var _ cadvisor.Interface = new(Fake)
@ -54,6 +55,7 @@ func (c *Fake) MachineInfo() (*cadvisorapi.MachineInfo, error) {
// We set it to non-zero values to make non-zero-capacity machines in Kubemark.
return &cadvisorapi.MachineInfo{
NumCores: 1,
InstanceID: cadvisorapi.InstanceID(c.NodeName),
MemoryCapacity: 4026531840,
}, nil
}