garbage

package
v0.1.0-rc.21 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

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