From 7b457fd33fa60dc94ca32387d6963d522eaa661a Mon Sep 17 00:00:00 2001 From: Dawn Chen Date: Fri, 16 Jan 2015 11:10:30 -0800 Subject: [PATCH] Separate colume for PodIP from kubectl get pods --- pkg/kubectl/resource_printer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/resource_printer.go b/pkg/kubectl/resource_printer.go index fb189b81468..2e56fd77c86 100644 --- a/pkg/kubectl/resource_printer.go +++ b/pkg/kubectl/resource_printer.go @@ -215,7 +215,7 @@ func (h *HumanReadablePrinter) validatePrintHandlerFunc(printFunc reflect.Value) return nil } -var podColumns = []string{"POD", "CONTAINER(S)", "IMAGE(S)", "HOST", "LABELS", "STATUS"} +var podColumns = []string{"POD", "IP", "CONTAINER(S)", "IMAGE(S)", "HOST", "LABELS", "STATUS"} var replicationControllerColumns = []string{"CONTROLLER", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "REPLICAS"} var serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP", "PORT"} var minionColumns = []string{"NAME", "LABELS"} @@ -267,7 +267,7 @@ func printPod(pod *api.Pod, w io.Writer) error { if len(containers) > 0 { firstContainer, containers = containers[0], containers[1:] } - _, err := fmt.Fprintf(w, "%s/%s\t%s\t%s\t%s\t%s\t%s\n", + _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n", pod.Name, pod.Status.PodIP, firstContainer.Name, @@ -280,7 +280,7 @@ func printPod(pod *api.Pod, w io.Writer) error { } // Lay out all the other containers on separate lines. for _, container := range containers { - _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n", "", container.Name, container.Image, "", "", "") + _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "", "", container.Name, container.Image, "", "", "") if err != nil { return err }