mirror of
https://github.com/rancher/types.git
synced 2025-09-12 21:13:18 +00:00
Add context to roleTemplate
This commit is contained in:
@@ -77,6 +77,7 @@ type RoleTemplate struct {
|
||||
Builtin bool `json:"builtin"`
|
||||
External bool `json:"external"`
|
||||
Hidden bool `json:"hidden"`
|
||||
Context string `json:"context"`
|
||||
RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"`
|
||||
}
|
||||
|
||||
|
@@ -96,7 +96,14 @@ func authzTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}).
|
||||
MustImport(&Version, v3.GlobalRole{}).
|
||||
MustImport(&Version, v3.GlobalRoleBinding{}).
|
||||
MustImport(&Version, v3.RoleTemplate{}).
|
||||
MustImportAndCustomize(&Version, v3.RoleTemplate{}, func(schema *types.Schema) {
|
||||
schema.MustCustomizeField("context", func(field types.Field) types.Field {
|
||||
field.Type = "enum"
|
||||
field.Options = []string{"cluster", "project"}
|
||||
field.Nullable = false
|
||||
return field
|
||||
})
|
||||
}).
|
||||
MustImport(&Version, v3.PodSecurityPolicyTemplate{}).
|
||||
MustImportAndCustomize(&Version, v3.ClusterRoleTemplateBinding{}, func(schema *types.Schema) {
|
||||
schema.MustCustomizeField("subjectKind", func(field types.Field) types.Field {
|
||||
|
Reference in New Issue
Block a user