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.
Click to show internal directories.
Click to hide internal directories.