cleaner

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

type Cleaner interface {
	// Start starts the cleaner loop.
	// The cleaner loop discovers stale allocations and clean up them.
	Start(ctx context.Context)
}

Cleaner is the interface of the cleaner package. The cleaner periodically scan the store and check for allocations which doesn't have related Pod in the k8s API. If allocation has no Pod for more than X checks, then the cleaner will release the allocation. Also, the cleaner will remove pool entries in the store if the pool has no allocation and pool configuration is unavailable in the Kubernetes API.

func New

func New(cachedClient client.Client, directClient client.Client, store storePkg.Store, poolConfReader pool.ConfigReader,
	checkInterval time.Duration,
	checkCountBeforeRelease int) Cleaner

New creates and initialize new cleaner instance "checkInterval" defines delay between checks for stale allocations. "checkCountBeforeRelease: defines how many check to do before remove the allocation

Jump to

Keyboard shortcuts

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