update structured log for fake_cpu_manager.go

This commit is contained in:
pacoxu 2021-03-12 16:06:52 +08:00
parent 20bc36c34d
commit 4cf80f160d

View File

@ -32,36 +32,36 @@ type fakeManager struct {
}
func (m *fakeManager) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, containerRuntime runtimeService, initialContainers containermap.ContainerMap) error {
klog.Info("[fake cpumanager] Start()")
klog.Info("Start()")
return nil
}
func (m *fakeManager) Policy() Policy {
klog.Info("[fake cpumanager] Policy()")
klog.InfoS("Policy()")
return NewNonePolicy()
}
func (m *fakeManager) Allocate(pod *v1.Pod, container *v1.Container) error {
klog.Infof("[fake cpumanager] Allocate (pod: %s, container: %s", pod.Name, container.Name)
klog.InfoS("Allocate", "pod", klog.KObj(pod), "containerName", container.Name)
return nil
}
func (m *fakeManager) AddContainer(pod *v1.Pod, container *v1.Container, containerID string) {
klog.Infof("[fake cpumanager] AddContainer (pod: %s, container: %s, container id: %s)", pod.Name, container.Name, containerID)
klog.InfoS("AddContainer", "pod", klog.KObj(pod), "containerName", container.Name, "containerID", containerID)
}
func (m *fakeManager) RemoveContainer(containerID string) error {
klog.Infof("[fake cpumanager] RemoveContainer (container id: %s)", containerID)
klog.InfoS("RemoveContainer", "containerID", containerID)
return nil
}
func (m *fakeManager) GetTopologyHints(pod *v1.Pod, container *v1.Container) map[string][]topologymanager.TopologyHint {
klog.Infof("[fake cpumanager] Get Container Topology Hints")
klog.InfoS("Get Container Topology Hints")
return map[string][]topologymanager.TopologyHint{}
}
func (m *fakeManager) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymanager.TopologyHint {
klog.Infof("[fake cpumanager] Get Pod Topology Hints")
klog.InfoS("Get Pod Topology Hints")
return map[string][]topologymanager.TopologyHint{}
}
@ -70,12 +70,12 @@ func (m *fakeManager) State() state.Reader {
}
func (m *fakeManager) GetCPUs(podUID, containerName string) cpuset.CPUSet {
klog.Infof("[fake cpumanager] GetCPUs(podUID: %s, containerName: %s)", podUID, containerName)
klog.InfoS("GetCPUs", "podUID", podUID, "containerName", container.Name)
return cpuset.CPUSet{}
}
func (m *fakeManager) GetAllocatableCPUs() cpuset.CPUSet {
klog.Infof("[fake cpumanager] Get Allocatable Cpus")
klog.InfoS("Get Allocatable Cpus")
return cpuset.CPUSet{}
}