Add node describe labels, creationTimestamp

This commit is contained in:
Deyuan Deng 2015-03-23 12:14:18 -04:00
parent a7f3d7d820
commit 4939c1137c
2 changed files with 3 additions and 1 deletions

View File

@ -501,7 +501,7 @@ __EOF__
kube::test::get_object_assert nodes "{{range.items}}{{.$id_field}}:{{end}}" '127.0.0.1:'
kube::test::describe_object_assert nodes "127.0.0.1" "Name:" "Conditions:" "Addresses:" "Capacity:" "Pods:"
kube::test::describe_object_assert nodes "127.0.0.1" "Name:" "Labels:" "CreationTimestamp:" "Conditions:" "Addresses:" "Capacity:" "Pods:"
###########
# Minions #

View File

@ -374,6 +374,8 @@ func (d *NodeDescriber) Describe(namespace, name string) (string, error) {
func describeNode(node *api.Node, pods []api.Pod, events *api.EventList) (string, error) {
return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", node.Name)
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(node.Labels))
fmt.Fprintf(out, "CreationTimestamp:\t%s\n", node.CreationTimestamp.Time.Format(time.RFC1123Z))
if len(node.Status.Conditions) > 0 {
fmt.Fprint(out, "Conditions:\n Type\tStatus\tLastProbeTime\tLastTransitionTime\tReason\tMessage\n")
for _, c := range node.Status.Conditions {