deckhouse_config

package
v1.62.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 19 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) 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

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 ModuleConfigStatus struct {
	Version string
	Message string
}

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 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 {
	GetGlobal() *modules.GlobalModule
	GetModule(name string) *modules.BasicModule
}

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