Skip to content

Commit

Permalink
Merge pull request kubernetes#86195 from yutedz/status-mgr-sync-stati…
Browse files Browse the repository at this point in the history
…c-15

Sync the status of static Pods
  • Loading branch information
k8s-ci-robot authored Jan 11, 2020
2 parents d3fe1d0 + f3c4695 commit 14ede42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/kubelet/kubelet_getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/cm"
"k8s.io/kubernetes/pkg/kubelet/config"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
kubepod "k8s.io/kubernetes/pkg/kubelet/pod"
"k8s.io/kubernetes/pkg/util/mount"
utilnode "k8s.io/kubernetes/pkg/util/node"
utilpath "k8s.io/utils/path"
Expand Down Expand Up @@ -171,8 +172,11 @@ func (kl *Kubelet) GetPods() []*v1.Pod {
// a kubelet running without apiserver requires an additional
// update of the static pod status. See #57106
for _, p := range pods {
if status, ok := kl.statusManager.GetPodStatus(p.UID); ok {
p.Status = status
if kubepod.IsStaticPod(p) {
if status, ok := kl.statusManager.GetPodStatus(p.UID); ok {
klog.V(2).Infof("status for pod %v updated to %v", p.Name, status)
p.Status = status
}
}
}
return pods
Expand Down

0 comments on commit 14ede42

Please sign in to comment.