Skip to content

Commit

Permalink
Merge pull request #4974 from k0sproject/backport-4865-to-release-1.30
Browse files Browse the repository at this point in the history
[Backport release-1.30] fix(helm): error gets removed from chart cr on subsequent reconciles
  • Loading branch information
jnummelin authored Sep 16, 2024
2 parents 4967c58 + 15af492 commit bd9ef6d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions pkg/component/controller/extensions_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,19 +365,20 @@ func (cr *ChartReconciler) updateOrInstallChart(ctx context.Context, chart helmv
return fmt.Errorf("can't reconcile installation for %q: %w", chart.GetName(), err)
}
} else {
if cr.chartNeedsUpgrade(chart) {
// update
chartRelease, err = cr.helm.UpgradeChart(ctx,
chart.Spec.ChartName,
chart.Spec.Version,
chart.Status.ReleaseName,
chart.Status.Namespace,
chart.Spec.YamlValues(),
timeout,
)
if err != nil {
return fmt.Errorf("can't reconcile upgrade for %q: %w", chart.GetName(), err)
}
if !cr.chartNeedsUpgrade(chart) {
return nil
}
// update
chartRelease, err = cr.helm.UpgradeChart(ctx,
chart.Spec.ChartName,
chart.Spec.Version,
chart.Status.ReleaseName,
chart.Status.Namespace,
chart.Spec.YamlValues(),
timeout,
)
if err != nil {
return fmt.Errorf("can't reconcile upgrade for %q: %w", chart.GetName(), err)
}
}
if err := apiretry.RetryOnConflict(apiretry.DefaultRetry, func() error {
Expand Down

0 comments on commit bd9ef6d

Please sign in to comment.