Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Move successful chart fetch signal to reconcile
Browse files Browse the repository at this point in the history
As the chart source getter methods are used in other places, e.g.
to compare the values checksums, and the condition update causes
the `LastUpdateTime` to renew.

Given this `LastUpdateTime` timestamp is used to determine if an
upgrade should be hold back for rolled back releases, it would
corrupt the 'state machine' and give a false positive, causing a
infinite loop of rollback-release.
  • Loading branch information
hiddeco committed Jul 31, 2019
1 parent 6c26327 commit ca1cd95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integrations/helm/chartsync/chartsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,13 @@ func (chs *ChartChangeSync) ReconcileReleaseDef(fhr fluxv1beta1.HelmRelease) {
if !ok {
return
}
chs.setCondition(fhr, fluxv1beta1.HelmReleaseChartFetched, v1.ConditionTrue, ReasonCloned, "successfully cloned git repo")
} else if fhr.Spec.ChartSource.RepoChartSource != nil {
chartPath, chartRevision, ok = chs.getRepoChartSource(fhr)
if !ok {
return
}
chs.setCondition(fhr, fluxv1beta1.HelmReleaseChartFetched, v1.ConditionTrue, ReasonDownloaded, "chart fetched: "+filepath.Base(chartPath))
}

if rel == nil {
Expand Down Expand Up @@ -535,7 +537,6 @@ func (chs *ChartChangeSync) getGitChartSource(fhr v1beta1.HelmRelease) (string,
}
return chartPath, chartRevision, false
}
chs.setCondition(fhr, fluxv1beta1.HelmReleaseChartFetched, v1.ConditionTrue, ReasonCloned, "successfully cloned git repo")
chartPath = filepath.Join(chartClone.export.Dir(), chartSource.Path)
chartRevision = chartClone.head

Expand Down Expand Up @@ -564,7 +565,6 @@ func (chs *ChartChangeSync) getRepoChartSource(fhr v1beta1.HelmRelease) (string,
return chartPath, chartRevision, false
}

chs.setCondition(fhr, fluxv1beta1.HelmReleaseChartFetched, v1.ConditionTrue, ReasonDownloaded, "chart fetched: "+filepath.Base(path))
chartPath = path
chartRevision = chartSource.Version

Expand Down

0 comments on commit ca1cd95

Please sign in to comment.