mirror of
https://github.com/rancher/types.git
synced 2025-07-10 12:03:04 +00:00
Merge pull request #133 from cjellick/optional-context
Make roletemplate.context optional
This commit is contained in:
commit
c425ec4228
@ -77,7 +77,7 @@ type RoleTemplate struct {
|
||||
Builtin bool `json:"builtin" norman:"nocreate,noupdate"`
|
||||
External bool `json:"external"`
|
||||
Hidden bool `json:"hidden"`
|
||||
Context string `json:"context"`
|
||||
Context string `json:"context" norman:"type=string,options=project|cluster"`
|
||||
RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"`
|
||||
}
|
||||
|
||||
|
@ -99,14 +99,7 @@ func authzTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}).
|
||||
MustImport(&Version, v3.GlobalRole{}).
|
||||
MustImport(&Version, v3.GlobalRoleBinding{}).
|
||||
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.RoleTemplate{}).
|
||||
MustImport(&Version, v3.PodSecurityPolicyTemplate{}).
|
||||
MustImportAndCustomize(&Version, v3.ClusterRoleTemplateBinding{}, func(schema *types.Schema) {
|
||||
schema.MustCustomizeField("subjectKind", func(field types.Field) types.Field {
|
||||
|
Loading…
Reference in New Issue
Block a user