Skip to content

Commit 27cccad

Browse files
JulienBalestramfpierre
authored andcommitted
Kubelet provides an updated and complete status of local-static Pods
1 parent b9bde60 commit 27cccad

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)