Skip to content

Commit 98c4c1e

Browse files
authored
Merge pull request kubernetes#77291 from tedyu/cpu-pod-stat
Query pod status outside loop over containers
2 parents ba28e0e + 3fc16a7 commit 98c4c1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/kubelet/cm/cpumanager/cpu_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec
225225
for _, pod := range m.activePods() {
226226
allContainers := pod.Spec.InitContainers
227227
allContainers = append(allContainers, pod.Spec.Containers...)
228+
status, ok := m.podStatusProvider.GetPodStatus(pod.UID)
228229
for _, container := range allContainers {
229-
status, ok := m.podStatusProvider.GetPodStatus(pod.UID)
230230
if !ok {
231-
klog.Warningf("[cpumanager] reconcileState: skipping pod; status not found (pod: %s, container: %s)", pod.Name, container.Name)
231+
klog.Warningf("[cpumanager] reconcileState: skipping pod; status not found (pod: %s)", pod.Name)
232232
failure = append(failure, reconciledContainer{pod.Name, container.Name, ""})
233233
break
234234
}

0 commit comments

Comments
 (0)