cleaner

package
v2.8.0 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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetJobsHistoryLimiter

type GetJobsHistoryLimiter interface {
	GetSuccessfulJobsHistoryLimit() *int
	GetFailedJobsHistoryLimit() *int
}

GetJobsHistoryLimiter provides the limits on how many jobs to clean.

type ObjectCleaner

type ObjectCleaner struct {
	Client client.Client
	Limits GetJobsHistoryLimiter
}

ObjectCleaner cleans old, finished job objects.

func NewObjectCleaner added in v2.6.0

func NewObjectCleaner(clt client.Client, Limits GetJobsHistoryLimiter) *ObjectCleaner

NewObjectCleaner creates a new ObjectCleaner instance.

func (*ObjectCleaner) CleanOldObjects

func (c *ObjectCleaner) CleanOldObjects(ctx context.Context, jobObjects k8upv1.JobObjectList) (int, error)

CleanOldObjects iterates over the given list and deletes them with the oldest object first until the amount returned from GetJobsHistoryLimiter remain. The function aborts early on errors. Returns the amount of deleted objects and possible errors.

Jump to

Keyboard shortcuts

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