Implement TopologyInfo and cpu_ids in podresources

It covers deviceplugin & cpumanager.

It has drawback, since cpuset and all other structs including cadvisor's keep
cpu as int, but for protobuf based interface is better to have fixed
int.
This patch also introduces additional interface CPUsProvider, while
DeviceProvider might have been extended too.

Checkpoint not covered by unit test.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>
This commit is contained in:
Alexey Perevalov
2020-07-14 18:03:56 +03:00
parent 62326a1846
commit a8b8995ef2
20 changed files with 183 additions and 39 deletions

View File

@@ -43,6 +43,11 @@ func (m *mockProvider) GetDevices(podUID, containerName string) []*podresourcesv
return args.Get(0).([]*podresourcesv1.ContainerDevices)
}
func (m *mockProvider) GetCPUs(podUID, containerName string) []int64 {
args := m.Called(podUID, containerName)
return args.Get(0).([]int64)
}
func (m *mockProvider) UpdateAllocatedDevices() {
m.Called()
}