kube_config_manager

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VerboseDebug bool
	// ConfigUpdated chan receives a new Config when global values are changed
	ConfigUpdated chan Config
	// ModuleConfigsUpdated chan receives a list of all ModuleConfig in configData. Updated items marked as IsUpdated.
	ModuleConfigsUpdated chan ModuleConfigs
)

Functions

func GetModulesNamesFromConfigData

func GetModulesNamesFromConfigData(configData map[string]string) map[string]bool

TODO make a method of KubeConfig TODO LOG: multierror? GetModulesNamesFromConfigData returns all keys in kube config except global modNameEnabled keys are also handled

Types

type Config

type Config struct {
	Values        utils.Values
	ModuleConfigs ModuleConfigs
}

func NewConfig

func NewConfig() *Config

type GlobalKubeConfig

type GlobalKubeConfig struct {
	Values     utils.Values
	Checksum   string
	ConfigData map[string]string
}

func GetGlobalKubeConfigFromConfigData

func GetGlobalKubeConfigFromConfigData(configData map[string]string) (*GlobalKubeConfig, error)

func GetGlobalKubeConfigFromValues

func GetGlobalKubeConfigFromValues(values utils.Values) (*GlobalKubeConfig, error)

type KubeConfigManager

type KubeConfigManager interface {
	WithContext(ctx context.Context)
	WithKubeClient(client klient.Client)
	WithNamespace(namespace string)
	WithConfigMapName(configMap string)
	WithValuesChecksumsAnnotation(annotation string)
	SetKubeGlobalValues(values utils.Values) error
	SetKubeModuleValues(moduleName string, values utils.Values) error
	Init() error
	Start()
	Stop()
	InitialConfig() *Config
	CurrentConfig() *Config
}

func NewKubeConfigManager

func NewKubeConfigManager() KubeConfigManager

type ModuleConfigs

type ModuleConfigs map[string]utils.ModuleConfig

func (ModuleConfigs) Names

func (m ModuleConfigs) Names() []string

type ModuleKubeConfig

type ModuleKubeConfig struct {
	utils.ModuleConfig
	Checksum   string
	ConfigData map[string]string
}

func ExtractModuleKubeConfig

func ExtractModuleKubeConfig(moduleName string, configData map[string]string) (*ModuleKubeConfig, error)

TODO make a method of KubeConfig ExtractModuleKubeConfig returns ModuleKubeConfig with values loaded from ConfigMap

func GetModuleKubeConfigFromValues

func GetModuleKubeConfigFromValues(moduleName string, values utils.Values) (*ModuleKubeConfig, error)

TODO make a method of KubeConfig

Jump to

Keyboard shortcuts

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