Skip to content

Commit

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

Sync the status of static Pods
  • Loading branch information
k8s-ci-robot authored Jan 11, 2020
2 parents 7d00ada + 67d2a34 commit e7f962b
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"
kubelettypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/util/mount"
utilnode "k8s.io/kubernetes/pkg/util/node"
utilpath "k8s.io/utils/path"
Expand Down Expand Up @@ -166,8 +167,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 kubelettypes.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 e7f962b

Please sign in to comment.