Documentation ¶
Index ¶
Constants ¶
View Source
const ConfigMapNameEnv = "CONFIG_LEADERELECTION_NAME"
Variables ¶
This section is empty.
Functions ¶
func ConfigMapName ¶
func ConfigMapName() string
ConfigMapName returns the name of the configmap to read for leader election settings.
Types ¶
type ComponentConfig ¶
type ComponentConfig struct { LeaderElect bool ResourceLock string LeaseDuration time.Duration RenewDeadline time.Duration RetryPeriod time.Duration }
ComponentConfig represents the leader election config for a single component.
type Config ¶
type Config struct { ResourceLock string LeaseDuration time.Duration RenewDeadline time.Duration RetryPeriod time.Duration EnabledComponents sets.String }
Config represents the leader election config for a set of components contained within a single namespace. Typically these will correspond to a single source repository, viz: serving or eventing.
func NewConfigFromConfigMap ¶
NewConfigFromConfigMap returns a new Config from the given ConfigMap.
func NewConfigFromMap ¶
NewConfigFromMap returns a Config for the given map, or an error.
func (*Config) GetComponentConfig ¶
func (c *Config) GetComponentConfig(name string) ComponentConfig
Click to show internal directories.
Click to hide internal directories.