Merge pull request #6231 from justinsb/pending_is_a_validation_issue

Consider pending pods to be a validation failure
This commit is contained in:
Kubernetes Prow Robot 2018-12-20 10:19:04 -08:00 committed by GitHub
commit 309515cbbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 8 deletions

View File

@ -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)
}

View File

@ -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
}