garbagecollector

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GarbageCollector

type GarbageCollector struct {
	// contains filtered or unexported fields
}

GarbageCollector runs reflectors to watch for changes of managed API objects. Currently it only watches Jobs. Triggered by Job creation and updates, it enqueues Jobs that have non-nil `.spec.ttlSecondsAfterFinished` to the `queue`. The GarbageCollector has workers who consume `queue`, check whether the Job TTL has expired or not; if the Job TTL hasn't expired, it will add the Job to the queue after the TTL is expected to expire; if the TTL has expired, the worker will send requests to the API server to delete the Jobs accordingly. This is implemented outside of Job controller for separation of concerns, and because it will be extended to handle other finishable resource types.

func NewGarbageCollector

func NewGarbageCollector(vkClient vcclientset.Interface) *GarbageCollector

NewGarbageCollector creates an instance of GarbageCollector

func (*GarbageCollector) Run

func (gb *GarbageCollector) Run(stopCh <-chan struct{})

Run starts the worker to clean up Jobs.

Jump to

Keyboard shortcuts

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