From dff4c265b2906eebf40534edff3c13d3aeb5f580 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Wed, 4 Oct 2023 11:52:19 +0300 Subject: [PATCH] fix: Consistent artifact fetching retry timing Artifact not found errors (HTTP 404) are requeue using the dependency interval, while for a nil Artifact, the interval used for retry was set to the apply retry one. Signed-off-by: Stefan Prodan --- internal/controller/kustomization_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controller/kustomization_controller.go b/internal/controller/kustomization_controller.go index 5432d672..3bb6d86d 100644 --- a/internal/controller/kustomization_controller.go +++ b/internal/controller/kustomization_controller.go @@ -244,10 +244,10 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques // Requeue the reconciliation if the source artifact is not found. if artifactSource.GetArtifact() == nil { - msg := "Source is not ready, artifact not found" + msg := fmt.Sprintf("Source artifact not found, retrying in %s", r.requeueDependency.String()) conditions.MarkFalse(obj, meta.ReadyCondition, kustomizev1.ArtifactFailedReason, msg) log.Info(msg) - return ctrl.Result{RequeueAfter: obj.GetRetryInterval()}, nil + return ctrl.Result{RequeueAfter: r.requeueDependency}, nil } // Check dependencies and requeue the reconciliation if the check fails.