1
0
mirror of https://github.com/rancher/types.git synced 2025-07-01 07:51:48 +00:00

DisplayName for role types

This commit is contained in:
Craig Jellick 2017-12-21 16:55:53 -07:00
parent 430ef19e10
commit cff909bb7b
2 changed files with 7 additions and 5 deletions

View File

@ -23,8 +23,9 @@ type GlobalRole struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
Builtin bool `json:"builtin"`
DisplayName string `json:"displayName,omitempty" norman:"required"`
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
Builtin bool `json:"builtin"`
}
type GlobalRoleBinding struct {
@ -39,6 +40,7 @@ type RoleTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
DisplayName string `json:"displayName,omitempty" norman:"required"`
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
Builtin bool `json:"builtin"`
External bool `json:"external"`

View File

@ -87,9 +87,9 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas {
func authzTypes(schemas *types.Schemas) *types.Schemas {
return schemas.
AddMapperForType(&Version, v3.Project{},
m.DisplayName{},
).
AddMapperForType(&Version, v3.Project{}, m.DisplayName{}).
AddMapperForType(&Version, v3.GlobalRole{}, m.DisplayName{}).
AddMapperForType(&Version, v3.RoleTemplate{}, m.DisplayName{}).
AddMapperForType(&Version, v3.ProjectRoleTemplateBinding{},
&m.Move{From: "subject/name", To: "subjectName"},
&m.Move{From: "subject/kind", To: "subjectKind"},