Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
// Run runs the garbage collector until all eligible Promotion resources have
// been deleted -- or until an unrecoverable error occurs.
Run(context.Context) error
}
Collector is an interface for the garbage collector.
func NewCollector ¶
func NewCollector(kubeClient client.Client, cfg CollectorConfig) Collector
NewCollector initializes and returns an implementation of the Collector interface.
type CollectorConfig ¶
type CollectorConfig struct {
// NumWorkers specifies the number of concurrent workers working on garbage
// collection. Tuning this too low will result in slow garbage collection.
// Tuning this too high will result in too many API calls and may result in
// throttling.
NumWorkers int `envconfig:"NUM_WORKERS" default:"3"`
// MaxRetainedPromotions specifies the maximum number of Promotions in
// terminal phases per Project that may be spared by the garbage collector.
MaxRetainedPromotions int `envconfig:"MAX_RETAINED_PROMOTIONS" default:"20"`
}
CollectorConfig is configuration for the garbage collector.
func CollectorConfigFromEnv ¶
func CollectorConfigFromEnv() CollectorConfig
CollectorConfigFromEnv returns a CollectorConfig populated from environment variables.
Click to show internal directories.
Click to hide internal directories.