fix forbid clusterrole with namespace

This commit is contained in:
xilabao 2016-11-08 16:25:33 +08:00
parent d8fa6a99a2
commit b346911299

View File

@ -1749,6 +1749,9 @@ func printRoleBindingList(list *rbac.RoleBindingList, w io.Writer, options Print
} }
func printClusterRole(clusterRole *rbac.ClusterRole, w io.Writer, options PrintOptions) error { func printClusterRole(clusterRole *rbac.ClusterRole, w io.Writer, options PrintOptions) error {
if options.WithNamespace {
return fmt.Errorf("clusterRole is not namespaced")
}
return printObjectMeta(clusterRole.ObjectMeta, w, options, false) return printObjectMeta(clusterRole.ObjectMeta, w, options, false)
} }