diff --git a/hack/runtime-cleanup/cmd/cleaner/cleaner.go b/hack/runtime-cleanup/cmd/cleaner/cleaner.go index de68dc69..5faa8462 100644 --- a/hack/runtime-cleanup/cmd/cleaner/cleaner.go +++ b/hack/runtime-cleanup/cmd/cleaner/cleaner.go @@ -8,6 +8,8 @@ import ( "time" ) +const deleteAfter = 24 * time.Hour + type RuntimeCleaner struct { k8sClient client.Client log *slog.Logger @@ -45,7 +47,7 @@ func (r RuntimeCleaner) removeOldRuntimes() error { } func isTimeForCleanup(runtimeObj imv1.Runtime) bool { - return runtimeObj.CreationTimestamp.Add(24 * time.Hour).Before(time.Now()) + return runtimeObj.CreationTimestamp.Add(deleteAfter).Before(time.Now()) } func isControlledByKIM(runtimeObj imv1.Runtime) bool {