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:
@@ -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"`
|
||||
|
@@ -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
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user