Query pod status outside loop over containers
This commit is contained in:
parent
16085784bc
commit
66ce52578a
@ -225,8 +225,8 @@ func (m *manager) reconcileState() (success []reconciledContainer, failure []rec
|
|||||||
for _, pod := range m.activePods() {
|
for _, pod := range m.activePods() {
|
||||||
allContainers := pod.Spec.InitContainers
|
allContainers := pod.Spec.InitContainers
|
||||||
allContainers = append(allContainers, pod.Spec.Containers...)
|
allContainers = append(allContainers, pod.Spec.Containers...)
|
||||||
|
status, ok := m.podStatusProvider.GetPodStatus(pod.UID)
|
||||||
for _, container := range allContainers {
|
for _, container := range allContainers {
|
||||||
status, ok := m.podStatusProvider.GetPodStatus(pod.UID)
|
|
||||||
if !ok {
|
if !ok {
|
||||||
klog.Warningf("[cpumanager] reconcileState: skipping pod; status not found (pod: %s, container: %s)", pod.Name, container.Name)
|
klog.Warningf("[cpumanager] reconcileState: skipping pod; status not found (pod: %s, container: %s)", pod.Name, container.Name)
|
||||||
failure = append(failure, reconciledContainer{pod.Name, container.Name, ""})
|
failure = append(failure, reconciledContainer{pod.Name, container.Name, ""})
|
||||||
|
Loading…
Reference in New Issue
Block a user