Skip to content

Commit

Permalink
Merge pull request #4973 from k0sproject/backport-4865-to-release-1.29
Browse files Browse the repository at this point in the history
[Backport release-1.29] fix(helm): error gets removed from chart cr on subsequent reconciles
  • Loading branch information
jnummelin authored Sep 16, 2024
2 parents 19be44b + 00d92bd commit 290fafd
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 @@ -364,19 +364,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 290fafd

Please sign in to comment.