Skip to content

Commit

Permalink
fix(helm): error gets removed from chart cr on subsequent reconciles
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Mosbaugh <ethan@replicated.com>
  • Loading branch information
emosbaugh committed Aug 15, 2024
1 parent 761867a commit 6fef437
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 @@ -291,19 +291,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 6fef437

Please sign in to comment.