Skip to content

Commit 1108686

Browse files
committed
node: cpu-mgr: Update klog.Infof(..., err) to klog.ErrorS(err,...)
We are trying to ensure consistency across resource managers when it comes to logging. While working on logging improvements for memory manager, it was identified that some parts of code base is still using klog.InfoS(..., err) instead of klog.ErrorS(err,...). This change is addressing this in CPU Manager. Signed-off-by: Swati Sehgal <[email protected]>
1 parent 2d0a4f7 commit 1108686

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/kubelet/cm/cpumanager/state/state_checkpoint.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (sc *stateCheckpoint) SetCPUSet(podUID string, containerName string, cset c
201201
sc.cache.SetCPUSet(podUID, containerName, cset)
202202
err := sc.storeState()
203203
if err != nil {
204-
klog.InfoS("Store state to checkpoint error", "err", err)
204+
klog.ErrorS(err, "Store state to checkpoint error", "podUID", podUID, "containerName", containerName)
205205
}
206206
}
207207

@@ -212,7 +212,7 @@ func (sc *stateCheckpoint) SetDefaultCPUSet(cset cpuset.CPUSet) {
212212
sc.cache.SetDefaultCPUSet(cset)
213213
err := sc.storeState()
214214
if err != nil {
215-
klog.InfoS("Store state to checkpoint error", "err", err)
215+
klog.ErrorS(err, "Store state to checkpoint error")
216216
}
217217
}
218218

@@ -223,7 +223,7 @@ func (sc *stateCheckpoint) SetCPUAssignments(a ContainerCPUAssignments) {
223223
sc.cache.SetCPUAssignments(a)
224224
err := sc.storeState()
225225
if err != nil {
226-
klog.InfoS("Store state to checkpoint error", "err", err)
226+
klog.ErrorS(err, "Store state to checkpoint error")
227227
}
228228
}
229229

@@ -234,7 +234,7 @@ func (sc *stateCheckpoint) Delete(podUID string, containerName string) {
234234
sc.cache.Delete(podUID, containerName)
235235
err := sc.storeState()
236236
if err != nil {
237-
klog.InfoS("Store state to checkpoint error", "err", err)
237+
klog.ErrorS(err, "Store state to checkpoint error", "podUID", podUID, "containerName", containerName)
238238
}
239239
}
240240

@@ -245,6 +245,6 @@ func (sc *stateCheckpoint) ClearState() {
245245
sc.cache.ClearState()
246246
err := sc.storeState()
247247
if err != nil {
248-
klog.InfoS("Store state to checkpoint error", "err", err)
248+
klog.ErrorS(err, "Store state to checkpoint error")
249249
}
250250
}

0 commit comments

Comments
 (0)