Update the chart if ReconcileStrategy changes

If the ReconcileStrategy is changed (from ChartVersion to Revision for
example), we should update the HelmChart.

Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
This commit is contained in:
Dylan Arbour 2021-10-09 21:40:35 -04:00
parent 54db7fd1cc
commit b724dcafbb
2 changed files with 9 additions and 0 deletions

View File

@ -200,6 +200,8 @@ func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1.HelmChart) bool
return true
case template.GetInterval(hr.Spec.Interval) != chart.Spec.Interval:
return true
case template.Spec.ReconcileStrategy != chart.Spec.ReconcileStrategy:
return true
case !reflect.DeepEqual(template.Spec.ValuesFiles, chart.Spec.ValuesFiles):
return true
case template.Spec.ValuesFile != chart.Spec.ValuesFile:

View File

@ -420,6 +420,13 @@ func Test_helmChartRequiresUpdate(t *testing.T) {
},
want: true,
},
{
name: "detects reconcile strategy change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {
hr.Spec.Chart.Spec.ReconcileStrategy = "Revision"
},
want: true,
},
{
name: "detects values files change",
modify: func(hr *v2.HelmRelease, hc *sourcev1.HelmChart) {