From 4cf80f160d14aedc97202938bf89d3edc91e61c7 Mon Sep 17 00:00:00 2001 From: pacoxu Date: Fri, 12 Mar 2021 16:06:52 +0800 Subject: [PATCH] update structured log for fake_cpu_manager.go --- pkg/kubelet/cm/cpumanager/fake_cpu_manager.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go b/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go index 1c7fa8b5498..427dc762d87 100644 --- a/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go +++ b/pkg/kubelet/cm/cpumanager/fake_cpu_manager.go @@ -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{} }