mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
add NodeCondition and PodCondition to kubectl describe node/pod
This commit is contained in:
parent
2fb4bd4724
commit
dac5e9b4d0
@ -193,6 +193,14 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
|
|||||||
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(pod.Labels))
|
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(pod.Labels))
|
||||||
fmt.Fprintf(out, "Status:\t%s\n", string(pod.Status.Phase))
|
fmt.Fprintf(out, "Status:\t%s\n", string(pod.Status.Phase))
|
||||||
fmt.Fprintf(out, "Replication Controllers:\t%s\n", getReplicationControllersForLabels(rc, labels.Set(pod.Labels)))
|
fmt.Fprintf(out, "Replication Controllers:\t%s\n", getReplicationControllersForLabels(rc, labels.Set(pod.Labels)))
|
||||||
|
if len(pod.Status.Conditions) > 0 {
|
||||||
|
fmt.Fprint(out, "Conditions:\n Kind\tStatus\n")
|
||||||
|
for _, c := range pod.Status.Conditions {
|
||||||
|
fmt.Fprintf(out, " %v \t%v \n",
|
||||||
|
c.Kind,
|
||||||
|
c.Status)
|
||||||
|
}
|
||||||
|
}
|
||||||
if events != nil {
|
if events != nil {
|
||||||
describeEvents(events, out)
|
describeEvents(events, out)
|
||||||
}
|
}
|
||||||
@ -285,6 +293,18 @@ func (d *MinionDescriber) Describe(namespace, name string) (string, error) {
|
|||||||
|
|
||||||
return tabbedString(func(out io.Writer) error {
|
return tabbedString(func(out io.Writer) error {
|
||||||
fmt.Fprintf(out, "Name:\t%s\n", minion.Name)
|
fmt.Fprintf(out, "Name:\t%s\n", minion.Name)
|
||||||
|
if len(minion.Status.Conditions) > 0 {
|
||||||
|
fmt.Fprint(out, "Conditions:\n Kind\tStatus\tLastProbeTime\tLastTransitionTime\tReason\tMessage\n")
|
||||||
|
for _, c := range minion.Status.Conditions {
|
||||||
|
fmt.Fprintf(out, " %v \t%v \t%s \t%s \t%v \t%v\n",
|
||||||
|
c.Kind,
|
||||||
|
c.Status,
|
||||||
|
c.LastProbeTime.Time.Format(time.RFC1123Z),
|
||||||
|
c.LastTransitionTime.Time.Format(time.RFC1123Z),
|
||||||
|
c.Reason,
|
||||||
|
c.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
if events != nil {
|
if events != nil {
|
||||||
describeEvents(events, out)
|
describeEvents(events, out)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user