mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
add InstanceID to fake cadvisor (used in Kubemark)
This commit is contained in:
parent
54b68a2a3f
commit
c174625116
@ -112,7 +112,9 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if config.Morph == "kubelet" {
|
if config.Morph == "kubelet" {
|
||||||
cadvisorInterface := new(cadvisortest.Fake)
|
cadvisorInterface := &cadvisortest.Fake{
|
||||||
|
NodeName: config.NodeName,
|
||||||
|
}
|
||||||
containerManager := cm.NewStubContainerManager()
|
containerManager := cm.NewStubContainerManager()
|
||||||
fakeDockerClient := libdocker.NewFakeDockerClient().WithTraceDisabled()
|
fakeDockerClient := libdocker.NewFakeDockerClient().WithTraceDisabled()
|
||||||
fakeDockerClient.EnableSleep = true
|
fakeDockerClient.EnableSleep = true
|
||||||
|
@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
// Fake cAdvisor implementation.
|
// Fake cAdvisor implementation.
|
||||||
type Fake struct {
|
type Fake struct {
|
||||||
|
NodeName string
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ cadvisor.Interface = new(Fake)
|
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.
|
// We set it to non-zero values to make non-zero-capacity machines in Kubemark.
|
||||||
return &cadvisorapi.MachineInfo{
|
return &cadvisorapi.MachineInfo{
|
||||||
NumCores: 1,
|
NumCores: 1,
|
||||||
|
InstanceID: cadvisorapi.InstanceID(c.NodeName),
|
||||||
MemoryCapacity: 4026531840,
|
MemoryCapacity: 4026531840,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user