From dac5e9b4d06b1657b81ed1842fda838c9668d765 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Mon, 9 Feb 2015 21:09:32 -0800 Subject: [PATCH] add NodeCondition and PodCondition to kubectl describe node/pod --- pkg/kubectl/describe.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index 148a74ff73b..17c4bb097f1 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -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, "Status:\t%s\n", string(pod.Status.Phase)) 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 { describeEvents(events, out) } @@ -285,6 +293,18 @@ func (d *MinionDescriber) Describe(namespace, name string) (string, error) { return tabbedString(func(out io.Writer) error { 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 { describeEvents(events, out) }