From 76148bc8b201463509e4badde939ccccff79a60b Mon Sep 17 00:00:00 2001 From: Lukasz Zajaczkowski Date: Mon, 27 Jan 2025 15:49:50 +0100 Subject: [PATCH] add TTL 3 hours --- controllers/osartifact_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/osartifact_controller.go b/controllers/osartifact_controller.go index a7dfc0c..249d6aa 100644 --- a/controllers/osartifact_controller.go +++ b/controllers/osartifact_controller.go @@ -51,6 +51,7 @@ const ( artifactExporterIndexAnnotation = "build.kairos.io/export-index" ready = "Ready" ) +const threeHours = int32(10800) var ( requeue = ctrl.Result{RequeueAfter: requeueAfter} @@ -351,7 +352,7 @@ func (r *OSArtifactReconciler) checkExport(ctx context.Context, artifact *osbuil }, }, }) - + job.Spec.TTLSecondsAfterFinished = ptr(threeHours) if err := controllerutil.SetOwnerReference(artifact, job, r.Scheme); err != nil { log.FromContext(ctx).Error(err, "failed to set owner reference on job") return ctrl.Result{Requeue: true}, nil