Merge pull request #785 from fluxcd/speed-up-recovery
fix: Retry failed releases when charts are available in storage
This commit is contained in:
commit
0c31fd395c
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/fluxcd/pkg/runtime/conditions"
|
||||||
"github.com/hashicorp/go-retryablehttp"
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"helm.sh/helm/v3/pkg/chart"
|
"helm.sh/helm/v3/pkg/chart"
|
||||||
"helm.sh/helm/v3/pkg/chartutil"
|
"helm.sh/helm/v3/pkg/chartutil"
|
||||||
|
|
@ -770,13 +771,13 @@ func (r *HelmReleaseReconciler) requestsForHelmChartChange(ctx context.Context,
|
||||||
}
|
}
|
||||||
|
|
||||||
var reqs []reconcile.Request
|
var reqs []reconcile.Request
|
||||||
for _, i := range list.Items {
|
for _, hr := range list.Items {
|
||||||
// If the revision of the artifact equals to the last attempted revision,
|
// If the HelmRelease is ready and the revision of the artifact equals to the
|
||||||
// we should not make a request for this HelmRelease
|
// last attempted revision, we should not make a request for this HelmRelease
|
||||||
if hc.GetArtifact().HasRevision(i.Status.LastAttemptedRevision) {
|
if conditions.IsReady(&hr) && hc.GetArtifact().HasRevision(hr.Status.LastAttemptedRevision) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)})
|
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&hr)})
|
||||||
}
|
}
|
||||||
return reqs
|
return reqs
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue