@@ -371,8 +371,8 @@ func AddHandlers(h printers.PrintHandler) {
371
371
372
372
roleBindingsColumnDefinitions := []metav1.TableColumnDefinition {
373
373
{Name : "Name" , Type : "string" , Format : "name" , Description : metav1.ObjectMeta {}.SwaggerDoc ()["name" ]},
374
+ {Name : "Role" , Type : "string" , Description : rbacv1beta1.RoleBinding {}.SwaggerDoc ()["roleRef" ]},
374
375
{Name : "Age" , Type : "string" , Description : metav1.ObjectMeta {}.SwaggerDoc ()["creationTimestamp" ]},
375
- {Name : "Role" , Type : "string" , Priority : 1 , Description : rbacv1beta1.RoleBinding {}.SwaggerDoc ()["roleRef" ]},
376
376
{Name : "Users" , Type : "string" , Priority : 1 , Description : "Users in the roleBinding" },
377
377
{Name : "Groups" , Type : "string" , Priority : 1 , Description : "Groups in the roleBinding" },
378
378
{Name : "ServiceAccounts" , Type : "string" , Priority : 1 , Description : "ServiceAccounts in the roleBinding" },
@@ -382,8 +382,8 @@ func AddHandlers(h printers.PrintHandler) {
382
382
383
383
clusterRoleBindingsColumnDefinitions := []metav1.TableColumnDefinition {
384
384
{Name : "Name" , Type : "string" , Format : "name" , Description : metav1.ObjectMeta {}.SwaggerDoc ()["name" ]},
385
+ {Name : "Role" , Type : "string" , Description : rbacv1beta1.ClusterRoleBinding {}.SwaggerDoc ()["roleRef" ]},
385
386
{Name : "Age" , Type : "string" , Description : metav1.ObjectMeta {}.SwaggerDoc ()["creationTimestamp" ]},
386
- {Name : "Role" , Type : "string" , Priority : 1 , Description : rbacv1beta1.ClusterRoleBinding {}.SwaggerDoc ()["roleRef" ]},
387
387
{Name : "Users" , Type : "string" , Priority : 1 , Description : "Users in the clusterRoleBinding" },
388
388
{Name : "Groups" , Type : "string" , Priority : 1 , Description : "Groups in the clusterRoleBinding" },
389
389
{Name : "ServiceAccounts" , Type : "string" , Priority : 1 , Description : "ServiceAccounts in the clusterRoleBinding" },
@@ -1630,11 +1630,11 @@ func printRoleBinding(obj *rbac.RoleBinding, options printers.GenerateOptions) (
1630
1630
Object : runtime.RawExtension {Object : obj },
1631
1631
}
1632
1632
1633
- row .Cells = append (row .Cells , obj .Name , translateTimestampSince (obj .CreationTimestamp ))
1633
+ roleRef := fmt .Sprintf ("%s/%s" , obj .RoleRef .Kind , obj .RoleRef .Name )
1634
+ row .Cells = append (row .Cells , obj .Name , roleRef , translateTimestampSince (obj .CreationTimestamp ))
1634
1635
if options .Wide {
1635
- roleRef := fmt .Sprintf ("%s/%s" , obj .RoleRef .Kind , obj .RoleRef .Name )
1636
1636
users , groups , sas , _ := rbac .SubjectsStrings (obj .Subjects )
1637
- row .Cells = append (row .Cells , roleRef , strings .Join (users , ", " ), strings .Join (groups , ", " ), strings .Join (sas , ", " ))
1637
+ row .Cells = append (row .Cells , strings .Join (users , ", " ), strings .Join (groups , ", " ), strings .Join (sas , ", " ))
1638
1638
}
1639
1639
return []metav1.TableRow {row }, nil
1640
1640
}
@@ -1657,11 +1657,11 @@ func printClusterRoleBinding(obj *rbac.ClusterRoleBinding, options printers.Gene
1657
1657
Object : runtime.RawExtension {Object : obj },
1658
1658
}
1659
1659
1660
- row .Cells = append (row .Cells , obj .Name , translateTimestampSince (obj .CreationTimestamp ))
1660
+ roleRef := fmt .Sprintf ("%s/%s" , obj .RoleRef .Kind , obj .RoleRef .Name )
1661
+ row .Cells = append (row .Cells , obj .Name , roleRef , translateTimestampSince (obj .CreationTimestamp ))
1661
1662
if options .Wide {
1662
- roleRef := fmt .Sprintf ("%s/%s" , obj .RoleRef .Kind , obj .RoleRef .Name )
1663
1663
users , groups , sas , _ := rbac .SubjectsStrings (obj .Subjects )
1664
- row .Cells = append (row .Cells , roleRef , strings .Join (users , ", " ), strings .Join (groups , ", " ), strings .Join (sas , ", " ))
1664
+ row .Cells = append (row .Cells , strings .Join (users , ", " ), strings .Join (groups , ", " ), strings .Join (sas , ", " ))
1665
1665
}
1666
1666
return []metav1.TableRow {row }, nil
1667
1667
}
0 commit comments