1
0
mirror of https://github.com/rancher/types.git synced 2025-09-19 00:46:53 +00:00

Add feature type

Added feature type, which will be used by rancher to toggle whether
features are enabled. This is part of the feature flagging feature.
This commit is contained in:
rmweir
2019-06-11 18:02:14 -07:00
parent 46ed3c5443
commit 1b3c529b0c
2 changed files with 14 additions and 0 deletions

View File

@@ -14,6 +14,14 @@ type Setting struct {
Source string `json:"source" norman:"nocreate,noupdate,options=db|default|env"`
}
type Feature struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Value *bool `json:"value" norman:"required"`
Default bool `json:"default" norman:"nocreate,noupdate"`
}
type ListenConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

View File

@@ -613,6 +613,12 @@ func globalTypes(schema *types.Schemas) *types.Schemas {
f.Required = true
return f
})
}).
MustImportAndCustomize(&Version, v3.Feature{}, func(schema *types.Schema) {
schema.MustCustomizeField("name", func(f types.Field) types.Field {
f.Required = true
return f
})
})
}