cleaner

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 10 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
	Log    logr.Logger
}

ObjectCleaner cleans old, finished job objects.

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