From ec7d5441949b2b36fd8d924923e874ce302230fe Mon Sep 17 00:00:00 2001 From: Deyuan Deng Date: Mon, 24 Nov 2014 18:41:11 -0500 Subject: [PATCH] Use formatLabel instead of label.Set --- docs/getting-started-guides/vagrant.md | 12 ++++++------ pkg/kubectl/resource_printer.go | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/getting-started-guides/vagrant.md b/docs/getting-started-guides/vagrant.md index d4680b62ead..2517ce2fdd7 100644 --- a/docs/getting-started-guides/vagrant.md +++ b/docs/getting-started-guides/vagrant.md @@ -80,9 +80,9 @@ $ export KUBERNETES_PROVIDER=vagrant $ ./cluster/kubecfg.sh list /minions Minion identifier Labels ---------- ---------- -10.245.2.4 -10.245.2.3 -10.245.2.2 +10.245.2.4 +10.245.2.3 +10.245.2.2 ``` ### Interacting with your Kubernetes cluster with the `kube-*` scripts. @@ -143,9 +143,9 @@ Your cluster is running, you can list the minions in your cluster: $ cluster/kubecfg.sh list /minions Minion identifier Labels ---------- ---------- -10.245.2.4 -10.245.2.3 -10.245.2.2 +10.245.2.4 +10.245.2.3 +10.245.2.2 ``` Now start running some containers! diff --git a/pkg/kubectl/resource_printer.go b/pkg/kubectl/resource_printer.go index a595fe2b201..b3b4955b732 100644 --- a/pkg/kubectl/resource_printer.go +++ b/pkg/kubectl/resource_printer.go @@ -28,7 +28,6 @@ import ( "text/template" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" - "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/golang/glog" "gopkg.in/v1/yaml" @@ -243,7 +242,7 @@ func printPod(pod *api.Pod, w io.Writer) error { _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", pod.Name, firstImage, podHostString(pod.Status.Host, pod.Status.HostIP), - labels.Set(pod.Labels), pod.Status.Phase) + formatLabels(pod.Labels), pod.Status.Phase) if err != nil { return err } @@ -269,7 +268,7 @@ func printPodList(podList *api.PodList, w io.Writer) error { func printReplicationController(controller *api.ReplicationController, w io.Writer) error { _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%d\n", controller.Name, makeImageList(&controller.Spec.Template.Spec), - labels.Set(controller.Spec.Selector), controller.Spec.Replicas) + formatLabels(controller.Spec.Selector), controller.Spec.Replicas) return err } @@ -283,8 +282,8 @@ func printReplicationControllerList(list *api.ReplicationControllerList, w io.Wr } func printService(svc *api.Service, w io.Writer) error { - _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\n", svc.Name, labels.Set(svc.Labels), - labels.Set(svc.Spec.Selector), svc.Spec.PortalIP, svc.Spec.Port) + _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\n", svc.Name, formatLabels(svc.Labels), + formatLabels(svc.Spec.Selector), svc.Spec.PortalIP, svc.Spec.Port) return err } @@ -298,7 +297,7 @@ func printServiceList(list *api.ServiceList, w io.Writer) error { } func printMinion(minion *api.Minion, w io.Writer) error { - _, err := fmt.Fprintf(w, "%s\t%s\n", minion.Name, labels.Set(minion.Labels)) + _, err := fmt.Fprintf(w, "%s\t%s\n", minion.Name, formatLabels(minion.Labels)) return err }