Skip to content

Commit 66ce525

Browse files
tedyuyutedz
authored andcommitted
Query pod status outside loop over containers
1 parent 1608578 commit 66ce525

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/kubelet/cm/cpumanager/cpu_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ 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 {
231231
klog.Warningf("[cpumanager] reconcileState: skipping pod; status not found (pod: %s, container: %s)", pod.Name, container.Name)
232232
failure = append(failure, reconciledContainer{pod.Name, container.Name, ""})

0 commit comments

Comments
 (0)