mirror of https://github.com/kubernetes/kops.git
Consider pending pods to be a validation failure
Also log the names of the non-ready containers.
This commit is contained in:
parent
ede358c19b
commit
f49aba4147
|
|
@ -187,7 +187,6 @@ func validateClusterOutputTable(result *validation.ValidationCluster, cluster *a
|
||||||
|
|
||||||
fmt.Fprintln(out, "INSTANCE GROUPS")
|
fmt.Fprintln(out, "INSTANCE GROUPS")
|
||||||
err := t.Render(instanceGroups, out, "NAME", "ROLE", "MACHINETYPE", "MIN", "MAX", "SUBNETS")
|
err := t.Render(instanceGroups, out, "NAME", "ROLE", "MACHINETYPE", "MIN", "MAX", "SUBNETS")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot render nodes for %q: %v", cluster.Name, err)
|
return fmt.Errorf("cannot render nodes for %q: %v", cluster.Name, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
|
|
@ -185,14 +186,27 @@ func (v *ValidationCluster) collectPodFailures(client kubernetes.Interface) erro
|
||||||
if pod.Status.Phase == v1.PodSucceeded {
|
if pod.Status.Phase == v1.PodSucceeded {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, status := range pod.Status.ContainerStatuses {
|
if pod.Status.Phase == v1.PodPending {
|
||||||
if !status.Ready {
|
|
||||||
v.addError(&ValidationError{
|
v.addError(&ValidationError{
|
||||||
Kind: "Pod",
|
Kind: "Pod",
|
||||||
Name: "kube-system/" + pod.Name,
|
Name: "kube-system/" + pod.Name,
|
||||||
Message: fmt.Sprintf("kube-system pod %q is not healthy", 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
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue