From 5c86d6aba58cdb0fb166bf88ff1f2bfa849d21cc Mon Sep 17 00:00:00 2001 From: Craig Jellick Date: Mon, 18 Dec 2017 17:03:07 -0700 Subject: [PATCH] Fix GlobalRoleBinding subject --- apis/management.cattle.io/v3/schema/schema.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 63911708..2580018d 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -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 + }) }) }