Change:
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: After labeling clusters in a Federation, when you type the field is empty. What you expected to happen: The fiels should contain information about the labels in the cluster How to reproduce it (as minimally and precisely as possible): a federation control pane in any Cloud Provider and any DNS provider your cluster: info aboyut the cluster with the flag: Note: if you describe it, you see the labels being : Environment: Kubernetes version (use ): 1.8.0 Cloud provider or hardware configuration**: anyone OS (e.g. from /etc/os-release): Ubuntu 16.04 Kernel (e.g. ): Linux Install tools: curl Others:
/sig multicluster
I'm working on it.

Discussion:
], library = ":go_default_library", deps = [ <ins> "//federation/apis/federation:go_default_library", </ins> "//federation/apis/federation/v1beta1:go_default_library", "//federation/client/clientset_generated/federation_clientset/fake:go_default_library", "//pkg/api:go_default_library",

{Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, {Name: "Status", Type: "string", Description: "Status of the cluster"}, {Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]}, <ins> {Name: "Labels", Type: "string", Description: "The labels of the cluster"}, </ins> } h.TableHandler(clusterColumnDefinitions, printCluster) h.TableHandler(clusterColumnDefinitions, printClusterList)

statuses = append(statuses, "Unknown") } row.Cells = append(row.Cells, obj.Name, strings.Join(statuses, ","), translateTimestamp(obj.CreationTimestamp)) <ins> if options.ShowLabels { row.Cells = append(row.Cells, labels.FormatLabels(obj.Labels)) } </ins> return []metav1alpha1.TableRow{row}, nil }

"k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/sets" <ins> "k8s.io/kubernetes/federation/apis/federation" </ins> "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/apis/apps"

} } } func TestPrintPod(t *testing.T) { tests := []struct { pod    api.Pod

buf.Reset() } } <ins> func TestPrintCluster(t *testing.T) { tests := []struct { cluster    federation.Cluster expect     []metav1alpha1.TableRow showLabels bool }{ { federation.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name:              "cluster1", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, }, []metav1alpha1.TableRow{{Cells: []interface{}{"cluster1", "Unknown", "0s"}}}, false, }, { federation.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name:              "cluster2", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, Labels:            map[string]string{"label1": "", "label2": "cluster"}, }, Status: federation.ClusterStatus{ Conditions: []federation.ClusterCondition{ { Status: api.ConditionTrue, Type:   federation.ClusterReady, }, { Status: api.ConditionFalse, Type:   federation.ClusterOffline, }, }, }, }, []metav1alpha1.TableRow{{Cells: []interface{}{"cluster2", "Ready,NotOffline", "0s", "label1=,label2=cluster"}}}, true, }, } for i, test := range tests { rows, err := printCluster(&test.cluster, printers.PrintOptions{ShowLabels: test.showLabels}) if err != nil { t.Fatal(err) } for i := range rows { rows[i].Object.Object = nil } if !reflect.DeepEqual(test.expect, rows) { t.Errorf("%d mismatch: %s", i, diff.ObjectReflectDiff(test.expect, rows)) } } } func TestPrintClusterList(t *testing.T) { tests := []struct { clusters   federation.ClusterList expect     []metav1alpha1.TableRow showLabels bool }{ // Test podList's pod: name, num of containers, restarts, container ready status { federation.ClusterList{ Items: []federation.Cluster{ { ObjectMeta: metav1.ObjectMeta{ Name:              "cluster1", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, }, Status: federation.ClusterStatus{ Conditions: []federation.ClusterCondition{ { Status: api.ConditionTrue, Type:   federation.ClusterReady, }, }, }, }, { ObjectMeta: metav1.ObjectMeta{ Name:              "cluster2", CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, Labels:            map[string]string{"label1": "", "label2": "cluster2"}, }, Status: federation.ClusterStatus{ Conditions: []federation.ClusterCondition{ { Status: api.ConditionTrue, Type:   federation.ClusterReady, }, { Status: api.ConditionFalse, Type:   federation.ClusterOffline, }, }, }, }, }, }, []metav1alpha1.TableRow{{Cells: []interface{}{"cluster1", "Ready", "0s", "<none>"}}, {Cells: []interface{}{"cluster2", "Ready,NotOffline", "0s", "label1=,label2=cluster2"}}}, true, }, } for _, test := range tests { rows, err := printClusterList(&test.clusters, printers.PrintOptions{ShowLabels: test.showLabels}) if err != nil { t.Fatal(err) } for i := range rows { rows[i].Object.Object = nil } if !reflect.DeepEqual(test.expect, rows) { t.Errorf("mismatch: %s", diff.ObjectReflectDiff(test.expect, rows)) } } } </ins>