mirror of https://github.com/kubernetes/kops.git
Merge pull request #6231 from justinsb/pending_is_a_validation_issue
Consider pending pods to be a validation failure
This commit is contained in:
commit
309515cbbb
|
@ -187,7 +187,6 @@ func validateClusterOutputTable(result *validation.ValidationCluster, cluster *a
|
|||
|
||||
fmt.Fprintln(out, "INSTANCE GROUPS")
|
||||
err := t.Render(instanceGroups, out, "NAME", "ROLE", "MACHINETYPE", "MIN", "MAX", "SUBNETS")
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot render nodes for %q: %v", cluster.Name, err)
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/api/core/v1"
|
||||
|
@ -185,15 +186,28 @@ func (v *ValidationCluster) collectPodFailures(client kubernetes.Interface) erro
|
|||
if pod.Status.Phase == v1.PodSucceeded {
|
||||
continue
|
||||
}
|
||||
for _, status := range pod.Status.ContainerStatuses {
|
||||
if !status.Ready {
|
||||
v.addError(&ValidationError{
|
||||
Kind: "Pod",
|
||||
Name: "kube-system/" + pod.Name,
|
||||
Message: fmt.Sprintf("kube-system pod %q is not healthy", pod.Name),
|
||||
})
|
||||
if pod.Status.Phase == v1.PodPending {
|
||||
v.addError(&ValidationError{
|
||||
Kind: "Pod",
|
||||
Name: "kube-system/" + pod.Name,
|
||||
Message: fmt.Sprintf("kube-system pod %q is pending", pod.Name),
|
||||
})
|
||||
continue
|
||||
}
|
||||
var notready []string
|
||||
for _, container := range pod.Status.ContainerStatuses {
|
||||
if !container.Ready {
|
||||
notready = append(notready, container.Name)
|
||||
}
|
||||
}
|
||||
if len(notready) != 0 {
|
||||
v.addError(&ValidationError{
|
||||
Kind: "Pod",
|
||||
Name: "kube-system/" + pod.Name,
|
||||
Message: fmt.Sprintf("kube-system pod %q is not ready (%s)", pod.Name, strings.Join(notready, ",")),
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue