mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #4222 from brendandburns/status
Add some more verbose logging around pod status.
This commit is contained in:
commit
8f69192be4
@ -169,17 +169,15 @@ func (p *PodCache) computePodStatus(pod *api.Pod) (api.PodStatus, error) {
|
||||
|
||||
// Assigned to non-existing node.
|
||||
if err != nil || len(nodeStatus.Conditions) == 0 {
|
||||
glog.V(5).Infof("node doesn't exist: %v %v, setting pod status to unknown", err, nodeStatus)
|
||||
newStatus.Phase = api.PodUnknown
|
||||
return newStatus, nil
|
||||
}
|
||||
|
||||
// Assigned to an unhealthy node.
|
||||
for _, condition := range nodeStatus.Conditions {
|
||||
if condition.Kind == api.NodeReady && condition.Status == api.ConditionNone {
|
||||
newStatus.Phase = api.PodUnknown
|
||||
return newStatus, nil
|
||||
}
|
||||
if condition.Kind == api.NodeReachable && condition.Status == api.ConditionNone {
|
||||
if (condition.Kind == api.NodeReady || condition.Kind == api.NodeReachable) && condition.Status == api.ConditionNone {
|
||||
glog.V(5).Infof("node status: %v, setting pod status to unknown", condition)
|
||||
newStatus.Phase = api.PodUnknown
|
||||
return newStatus, nil
|
||||
}
|
||||
@ -189,6 +187,7 @@ func (p *PodCache) computePodStatus(pod *api.Pod) (api.PodStatus, error) {
|
||||
newStatus.HostIP = nodeStatus.HostIP
|
||||
|
||||
if err != nil {
|
||||
glog.Errorf("error getting pod status: %v, setting status to unknown", err)
|
||||
newStatus.Phase = api.PodUnknown
|
||||
} else {
|
||||
newStatus.Info = result.Status.Info
|
||||
|
Loading…
Reference in New Issue
Block a user