Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyConfig(cfg *Config)
- func BindFlags(cfg *Config, rootCmd *cobra.Command, cmd *cobra.Command)
- func DefineDebugCommands(rootCmd *cobra.Command)
- func ParseEnv(cfg *Config) error
- type AdmissionSettings
- type AppSettings
- type Config
- type DebugSettings
- type HelmSettings
- type KubeSettings
- type LogSettings
- type ObjectPatcherSettings
Constants ¶
View Source
const ( DefaultTempDir = "/tmp/addon-operator" DefaultDebugUnixSocket = "/var/run/addon-operator/debug.socket" )
Variables ¶
View Source
var ( AppName = "addon-operator" AppDescription = "" Version = "dev" ListenAddress = "0.0.0.0" ListenPort = "9650" DefaultPrometheusMetricsPrefix = "addon_operator_" PrometheusMetricsPrefix = DefaultPrometheusMetricsPrefix Helm3HistoryMax int32 = 10 Helm3Timeout = 20 * time.Minute HelmIgnoreRelease = "" HelmMonitorKubeClientQpsDefault = "5" HelmMonitorKubeClientQps float32 HelmMonitorKubeClientBurstDefault = "10" HelmMonitorKubeClientBurst int Namespace = "" ConfigMapName = "addon-operator" GlobalHooksDir = "global-hooks" ModulesDir = "modules" TempDir = "" ShellChrootDir = "" UnnumberedModuleOrder = 1 AdmissionServerListenPort = "9651" AdmissionServerCertsDir = "" AdmissionServerEnabled = false // StrictModeEnabled fail with error if MODULES_DIR/values.yaml does not exist StrictModeEnabled = false // AppliedExtenders defines the list and the order of applied module extenders AppliedExtenders = "" // ExtraLabels defines strings for CRDs label selector ExtraLabels = "heritage=addon-operator" // CRDsFilters defines filters for CRD files, example `doc-,_` CRDsFilters = "doc-,_" // NumberOfParallelQueues defines the number of precreated parallel queues for parallel execution NumberOfParallelQueues = 20 ParallelQueuePrefix = "parallel_queue" ParallelQueueNamePattern = ParallelQueuePrefix + "_%d" // Kube client settings (previously from shell-operator globals) KubeContext string KubeConfig string KubeServer string KubeClientQPS float32 KubeClientBurst int ObjectPatcherKubeClientQPS float32 ObjectPatcherKubeClientBurst int ObjectPatcherKubeClientTimeout time.Duration // Debug settings (previously from shell-operator globals) DebugUnixSocket string DebugHTTPServerAddr string DebugKeepTmpFiles bool DebugKubernetesAPI bool // Log settings (previously from shell-operator globals) LogLevel string LogType string LogNoTime bool LogProxyHookJSON bool )
Functions ¶
func ApplyConfig ¶ added in v1.21.0
func ApplyConfig(cfg *Config)
ApplyConfig copies Config values into package-level variables for backward compatibility with code that reads them directly (e.g. module_manager).
func BindFlags ¶ added in v1.21.0
BindFlags registers all operator CLI flags on cmd, using the current cfg values (already merged with env vars and hardcoded defaults) as flag defaults. An explicit CLI flag always wins.
func DefineDebugCommands ¶
Types ¶
type AdmissionSettings ¶ added in v1.21.0
type AppSettings ¶ added in v1.21.0
type AppSettings struct {
ModulesDir string `env:"MODULES_DIR"`
GlobalHooksDir string `env:"GLOBAL_HOOKS_DIR"`
TempDir string `env:"TMP_DIR"`
Namespace string `env:"NAMESPACE"`
ListenAddress string `env:"LISTEN_ADDRESS"`
ListenPort string `env:"LISTEN_PORT"`
ConfigMapName string `env:"CONFIG_MAP"`
PrometheusMetricsPrefix string `env:"PROMETHEUS_METRICS_PREFIX"`
UnnumberedModuleOrder int `env:"UNNUMBERED_MODULES_ORDER"`
ShellChrootDir string `env:"SHELL_CHROOT_DIR"`
StrictModeEnabled bool `env:"STRICT_CHECK_VALUES_MODE_ENABLED"`
AppliedExtenders string `env:"APPLIED_MODULE_EXTENDERS"`
ExtraLabels string `env:"CRD_EXTRA_LABELS"`
CRDsFilters string `env:"CRD_FILTER_PREFIXES"`
}
type Config ¶ added in v1.21.0
type Config struct {
App AppSettings `envPrefix:"ADDON_OPERATOR_"`
Helm HelmSettings `envPrefix:"HELM_"`
Admission AdmissionSettings `envPrefix:"ADDON_OPERATOR_"`
Kube KubeSettings `envPrefix:"KUBE_"`
ObjectPatcher ObjectPatcherSettings `envPrefix:"OBJECT_PATCHER_"`
Debug DebugSettings `envPrefix:"DEBUG_"`
Log LogSettings `envPrefix:"LOG_"`
}
Config is the single source of truth for addon-operator configuration. Populate it in stages: NewConfig sets hardcoded defaults, ParseEnv overrides with environment variables, BindFlags registers CLI flags whose defaults are the current cfg values so that an explicit flag always wins. Priority: CLI flags > env vars > hardcoded defaults.
type DebugSettings ¶ added in v1.21.0
type HelmSettings ¶ added in v1.21.0
type KubeSettings ¶ added in v1.21.0
type LogSettings ¶ added in v1.21.0
Click to show internal directories.
Click to hide internal directories.