Documentation ¶
Index ¶
- Constants
- func GeneratedConfigMap(data map[string]string) *v1.ConfigMap
- func GetAllConfigs(kubeClient k8s.Client) ([]*v1alpha1.ModuleConfig, error)
- func GetConfigMap(klient k8s.Client, ns string, name string) (*v1.ConfigMap, error)
- func GetDeckhouseConfigMap(klient k8s.Client) (*v1.ConfigMap, error)
- func GetGeneratedConfigMap(klient k8s.Client) (*v1.ConfigMap, error)
- func InitService(mm ModuleManager)
- func IsServiceInited() bool
- func SetModuleConfigEnabledFlag(kubeClient k8s.Client, name string, enabled bool) error
- type ConfigService
- func (srv *ConfigService) AddModuleNameToSource(moduleName, moduleSource string)
- func (srv *ConfigService) AddPossibleName(name string)
- func (srv *ConfigService) ConfigValidator() *ConfigValidator
- func (srv *ConfigService) ModuleToSourcesNames() map[string]string
- func (srv *ConfigService) PossibleNames() set.Set
- func (srv *ConfigService) SetModuleNameToSources(allModuleNamesToSources map[string]string)
- func (srv *ConfigService) StatusReporter() *StatusReporter
- type ConfigValidator
- type ModuleConfigStatus
- type ModuleManager
- type ModuleStatus
- type StatusReporter
- type ValidationResult
- type ValuesValidator
Constants ¶
const DeckhouseConfigMapName = "deckhouse"
const DeckhouseNS = "d8-system"
const GeneratedConfigMapName = "deckhouse-generated-config-do-not-edit"
Variables ¶
This section is empty.
Functions ¶
func GetAllConfigs ¶
func GetAllConfigs(kubeClient k8s.Client) ([]*v1alpha1.ModuleConfig, error)
GetAllConfigs returns all ModuleConfig objects.
func GetConfigMap ¶
func GetDeckhouseConfigMap ¶
GetDeckhouseConfigMap returns default ConfigMap with config values (ConfigMap/deckhouse).
func GetGeneratedConfigMap ¶
GetGeneratedConfigMap returns generated ConfigMap with config values.
func InitService ¶
func InitService(mm ModuleManager)
func IsServiceInited ¶ added in v1.57.0
func IsServiceInited() bool
Types ¶
type ConfigService ¶
type ConfigService struct {
// contains filtered or unexported fields
}
func Service ¶
func Service() *ConfigService
func (*ConfigService) AddModuleNameToSource ¶ added in v1.51.0
func (srv *ConfigService) AddModuleNameToSource(moduleName, moduleSource string)
func (*ConfigService) AddPossibleName ¶ added in v1.59.0
func (srv *ConfigService) AddPossibleName(name string)
func (*ConfigService) ConfigValidator ¶
func (srv *ConfigService) ConfigValidator() *ConfigValidator
func (*ConfigService) ModuleToSourcesNames ¶ added in v1.51.0
func (srv *ConfigService) ModuleToSourcesNames() map[string]string
func (*ConfigService) PossibleNames ¶
func (srv *ConfigService) PossibleNames() set.Set
func (*ConfigService) SetModuleNameToSources ¶ added in v1.51.0
func (srv *ConfigService) SetModuleNameToSources(allModuleNamesToSources map[string]string)
func (*ConfigService) StatusReporter ¶
func (srv *ConfigService) StatusReporter() *StatusReporter
type ConfigValidator ¶
type ConfigValidator struct {
// contains filtered or unexported fields
}
ConfigValidator is a validator for values in ModuleConfig.
func NewConfigValidator ¶
func NewConfigValidator(valuesValidator ValuesValidator) *ConfigValidator
func (*ConfigValidator) Validate ¶
func (c *ConfigValidator) Validate(cfg *v1alpha1.ModuleConfig) ValidationResult
Validate checks ModuleConfig resource: - check if resource is well-formed - runs conversions for spec.settings if it`s needed - use OpenAPI schema defined in related config-values.yaml file to validate converted spec.settings. TODO(future) return cfg, error. Put cfg.Spec into result cfg.
type ModuleConfigStatus ¶ added in v1.59.0
type ModuleManager ¶
type ModuleManager interface { IsModuleEnabled(modName string) bool GetGlobal() *modules.GlobalModule GetModule(modName string) *modules.BasicModule GetModuleNames() []string GetEnabledModuleNames() []string }
ModuleManager interface is a part of addon-operator's ModuleManager interface with methods needed for deckhouse-config package.
type ModuleStatus ¶ added in v1.59.0
type StatusReporter ¶
type StatusReporter struct {
// contains filtered or unexported fields
}
func NewModuleInfo ¶
func NewModuleInfo(mm ModuleManager, possibleNames set.Set) *StatusReporter
func (*StatusReporter) ForConfig ¶
func (s *StatusReporter) ForConfig(cfg *v1alpha1.ModuleConfig) ModuleConfigStatus
func (*StatusReporter) ForModule ¶ added in v1.59.0
func (s *StatusReporter) ForModule(module *v1alpha1.Module, cfg *v1alpha1.ModuleConfig, bundleName string) ModuleStatus
type ValidationResult ¶
type ValidationResult struct { Settings map[string]interface{} Version int Warning string Error string }
func (ValidationResult) HasError ¶
func (v ValidationResult) HasError() bool
HasError return true if result has error. TODO(future) use regular error instead.
type ValuesValidator ¶
type ValuesValidator interface { GetGlobal() *modules.GlobalModule GetModule(name string) *modules.BasicModule }
ValuesValidator is a part of ValuesValidator from addon-operator with needed methods to validate config values.