Skip to content

Commit 116f06e

Browse files
authored
Merge pull request kubernetes#77661 from mfpierre/fix-static-pods-kubelet-status
Kubelet status manager sync the status of local Pods
2 parents 5c4b652 + 27cccad commit 116f06e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/kubelet/kubelet_getters.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,15 @@ func (kl *Kubelet) getPodResourcesDir() string {
162162
// GetPods returns all pods bound to the kubelet and their spec, and the mirror
163163
// pods.
164164
func (kl *Kubelet) GetPods() []*v1.Pod {
165-
return kl.podManager.GetPods()
165+
pods := kl.podManager.GetPods()
166+
// a kubelet running without apiserver requires an additional
167+
// update of the static pod status. See #57106
168+
for _, p := range pods {
169+
if status, ok := kl.statusManager.GetPodStatus(p.UID); ok {
170+
p.Status = status
171+
}
172+
}
173+
return pods
166174
}
167175

168176
// GetRunningPods returns all pods running on kubelet from looking at the

0 commit comments

Comments
 (0)