From ef135a141fd82be2ce8f6ba21e9af1daaa5136b4 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Thu, 5 Oct 2023 10:34:05 +0300 Subject: [PATCH] fix: Retry when artifacts are available in storage Signed-off-by: Stefan Prodan --- internal/controller/kustomization_indexers.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/controller/kustomization_indexers.go b/internal/controller/kustomization_indexers.go index 6fb466eb..226fa1e1 100644 --- a/internal/controller/kustomization_indexers.go +++ b/internal/controller/kustomization_indexers.go @@ -20,6 +20,7 @@ import ( "context" "fmt" + "github.com/fluxcd/pkg/runtime/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -56,9 +57,9 @@ func (r *KustomizationReconciler) requestsForRevisionChangeOf(indexKey string) h } var dd []dependency.Dependent for _, d := range list.Items { - // If the revision of the artifact equals to the last attempted revision, - // we should not make a request for this Kustomization - if repo.GetArtifact().HasRevision(d.Status.LastAttemptedRevision) { + // If the Kustomization is ready and the revision of the artifact equals + // to the last attempted revision, we should not make a request for this Kustomization + if conditions.IsReady(&d) && repo.GetArtifact().HasRevision(d.Status.LastAttemptedRevision) { continue } dd = append(dd, d.DeepCopy())