Skip to content

Commit 7997c93

Browse files
committed
node: cpu-mgr: Adhere to the message style guidelines
Ensure that the log messages adhere to the message style guildelines as captured [here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#message-style-guidelines). Signed-off-by: Swati Sehgal <[email protected]>
1 parent ca2c46a commit 7997c93

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pkg/kubelet/cm/cpumanager/cpu_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec
467467
cset := m.state.GetCPUSetOrDefault(string(pod.UID), container.Name)
468468
if cset.IsEmpty() {
469469
// NOTE: This should not happen outside of tests.
470-
klog.V(2).InfoS("ReconcileState: skipping container; assigned cpuset is empty", "pod", klog.KObj(pod), "containerName", container.Name)
470+
klog.V(2).InfoS("ReconcileState: skipping container; empty cpuset assigned", "pod", klog.KObj(pod), "containerName", container.Name)
471471
failure = append(failure, reconciledContainer{pod.Name, container.Name, containerID})
472472
continue
473473
}

pkg/kubelet/cm/cpumanager/policy_static.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func (p *staticPolicy) guaranteedCPUs(pod *v1.Pod, container *v1.Container) int
473473
}
474474
cpuValue := cpuQuantity.Value()
475475
if cpuValue*1000 != cpuQuantity.MilliValue() {
476-
klog.V(5).InfoS("Exclusive CPU allocation skipped, pod is not requesting integral CPUs", "pod", klog.KObj(pod), "containerName", container.Name, "cpu", cpuValue)
476+
klog.V(5).InfoS("Exclusive CPU allocation skipped, pod requested non-integral CPUs", "pod", klog.KObj(pod), "containerName", container.Name, "cpu", cpuValue)
477477
return 0
478478
}
479479
// Safe downcast to do for all systems with < 2.1 billion CPUs.

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.ErrorS(err, "Store state to checkpoint error", "podUID", podUID, "containerName", containerName)
204+
klog.ErrorS(err, "Failed to store state to checkpoint", "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.ErrorS(err, "Store state to checkpoint error")
215+
klog.ErrorS(err, "Failed to store state to checkpoint")
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.ErrorS(err, "Store state to checkpoint error")
226+
klog.ErrorS(err, "Failed to store state to checkpoint")
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.ErrorS(err, "Store state to checkpoint error", "podUID", podUID, "containerName", containerName)
237+
klog.ErrorS(err, "Failed to store state to checkpoint", "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.ErrorS(err, "Store state to checkpoint error")
248+
klog.ErrorS(err, "Failed to store state to checkpoint")
249249
}
250250
}

0 commit comments

Comments
 (0)