Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultKubeconfigPath = "" DefaultClusterTimeoutSeconds = 10 DefaultHealthcheckPort = 8000 DefaultHealthcheckEnabled = true DefaultAdmissionControllerPort = 443 DefaultAdmissionControllerEnabled = true DefaultTlsEnabled = false DefaultTlsCertPath = "/etc/markhor/tls/server.crt" DefaultTlsKeyPath = "/etc/markhor/tls/server.key" DefaultLoggingLevel = "info" DefaultLoggingStyle = "text" DefaultLoggingLogToStdout = true DefaultBehaviorFieldManagerName = "markhork8s.github.io" DefaultBehaviorFieldManagerForceUpdates = false DefaultMarkorSecretsHierarchySeparatorDefault = "/" DefaultMarkorSecretsHierarchySeparatorAllowOverride = true DefaultMarkorSecretsHierarchySeparatorWarnOnOverride = false //#nosec G101 -- This is a false positive (gosec) DefaultMarkorSecretsManagedLabelDefault = "app.kubernetes.io/managed-by" DefaultMarkorSecretsManagedLabelAllowOverride = false DefaultMarkorSecretsManagedLabelWarnOnOverride = true )
Variables ¶
View Source
var ( DefaultLoggingAdditionalLogFiles = []string{} DefaultBehaviorNamespaces = []string{} DefaultBehaviorExcludedNamespaces = []string{} )
Can't make these costants
View Source
var LoggerLevels = map[string]slog.Level{ "info": slog.LevelInfo, "debug": slog.LevelDebug, "warning": slog.LevelWarn, "error": slog.LevelError, }
Functions ¶
func SetupLogging ¶
func ValidateConfig ¶
This function sanitizes the Markhor configuration before it is used
Types ¶
type Config ¶
type Config struct {
Kubernetes kubernetesConfig `mapstructure:"kubernetes"`
Logging loggingConfig `mapstructure:"logging"`
Behavior behaviorConfig `mapstructure:"behavior"`
MarkorSecrets MarkhorSecretsConfig `mapstructure:"markorSecrets"`
Healthcheck HealthcheckConfig `mapstructure:"healthcheck"`
AdmissionController AdmissionControllerConfig `mapstructure:"admissionController"`
Tls TlsConfig `mapstructure:"tls"`
}
func ParseConfig ¶
Parses the program configuration (from CLI and file). Will terminate the execution if it fails since it would not be illogical to proceed w/o a valid config
type DefaultOverrideStruct ¶
type HealthcheckConfig ¶
type MarkhorSecretsConfig ¶
type MarkhorSecretsConfig struct {
HierarchySeparator DefaultOverrideStruct `mapstructure:"hierarchySeparator"`
ManagedLabel DefaultOverrideStruct `mapstructure:"managedLabel"`
}
Click to show internal directories.
Click to hide internal directories.