deckhouse_config

package
v1.59.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DeckhouseConfigMapName = "deckhouse"
View Source
const DeckhouseNS = "d8-system"
View Source
const GeneratedConfigMapName = "deckhouse-generated-config-do-not-edit"

Variables

This section is empty.

Functions

func GeneratedConfigMap

func GeneratedConfigMap(data map[string]string) *v1.ConfigMap

func GetAllConfigs

func GetAllConfigs(kubeClient k8s.Client) ([]*v1alpha1.ModuleConfig, error)

GetAllConfigs returns all ModuleConfig objects.

func GetConfigMap

func GetConfigMap(klient k8s.Client, ns string, name string) (*v1.ConfigMap, error)

func GetDeckhouseConfigMap

func GetDeckhouseConfigMap(klient k8s.Client) (*v1.ConfigMap, error)

GetDeckhouseConfigMap returns default ConfigMap with config values (ConfigMap/deckhouse).

func GetGeneratedConfigMap

func GetGeneratedConfigMap(klient k8s.Client) (*v1.ConfigMap, error)

GetGeneratedConfigMap returns generated ConfigMap with config values.

func InitService

func InitService(mm ModuleManager)

func IsServiceInited added in v1.57.0

func IsServiceInited() bool

func SetModuleConfigEnabledFlag added in v1.45.0

func SetModuleConfigEnabledFlag(kubeClient k8s.Client, name string, enabled bool) error

SetModuleConfigEnabledFlag updates spec.enabled flag or creates a new ModuleConfig with spec.enabled flag.

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) GetValuesValidator added in v1.56.0

func (srv *ConfigService) GetValuesValidator() *validation.ValuesValidator

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

func (*ConfigService) ValidateModule added in v1.49.0

func (srv *ConfigService) ValidateModule(module *modules.BasicModule) error

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) ConvertToLatest

func (c *ConfigValidator) ConvertToLatest(cfg *v1alpha1.ModuleConfig) ValidationResult

ConvertToLatest checks if ModuleConfig resource is well-formed and runs conversions for spec.settings is needed. TODO(future) return cfg, error. Put cfg.Spec into result cfg.

func (*ConfigValidator) Validate

Validate checks ModuleConfig resource: - check if resource is well-formed - runs conversions for spec.settings is 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 ModuleConfigStatus struct {
	Version string
	Message string
}

type ModuleManager

type ModuleManager interface {
	IsModuleEnabled(modName string) bool
	GetModule(modName string) *modules.BasicModule
	GetModuleNames() []string
	GetEnabledModuleNames() []string
	GetValuesValidator() *validation.ValuesValidator
	ValidateModule(module *modules.BasicModule) error
}

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 ModuleStatus struct {
	Status     string
	Message    string
	HooksState string
}

type StatusReporter

type StatusReporter struct {
	// contains filtered or unexported fields
}

func NewModuleInfo

func NewModuleInfo(mm ModuleManager, possibleNames set.Set) *StatusReporter

func (*StatusReporter) ForConfig

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 {
	GetSchema(schemaType validation.SchemaType, valuesType validation.SchemaType, modName string) *spec.Schema
	ValidateGlobalConfigValues(values utils.Values) error
	ValidateModuleConfigValues(moduleName string, values utils.Values) error
}

ValuesValidator is a part of ValuesValidator from addon-operator with needed methods to validate config values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL