mirror of
https://github.com/rancher/types.git
synced 2025-06-27 14:06:49 +00:00
Fix GlobalRoleBinding subject
This commit is contained in:
parent
c4a95c3c8b
commit
5c86d6aba5
@ -102,6 +102,11 @@ func authzTypes(schemas *types.Schemas) *types.Schemas {
|
||||
&m.Move{From: "subject/namespace", To: "subjectNamespace"},
|
||||
&m.Drop{Field: "subject"},
|
||||
).
|
||||
AddMapperForType(&Version, v3.GlobalRoleBinding{},
|
||||
&m.Move{From: "subject/name", To: "subjectName"},
|
||||
&m.Move{From: "subject/kind", To: "subjectKind"},
|
||||
&m.Drop{Field: "subject"},
|
||||
).
|
||||
MustImportAndCustomize(&Version, v3.Project{}, func(schema *types.Schema) {
|
||||
schema.SubContext = "projects"
|
||||
}).
|
||||
@ -124,6 +129,14 @@ func authzTypes(schemas *types.Schemas) *types.Schemas {
|
||||
field.Nullable = false
|
||||
return field
|
||||
})
|
||||
}).
|
||||
MustImportAndCustomize(&Version, v3.GlobalRoleBinding{}, func(schema *types.Schema) {
|
||||
schema.MustCustomizeField("subjectKind", func(field types.Field) types.Field {
|
||||
field.Type = "enum"
|
||||
field.Options = []string{"User", "Group", "Principal"}
|
||||
field.Nullable = false
|
||||
return field
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user