Skip to content

Commit

Permalink
Set correct labels on helm release during upgrade (#1017)
Browse files Browse the repository at this point in the history
Write the correct label set to the helm release. This commit fixes an issue
where the upgrades get wedged after the first upgrade when following
legacy upgade semantics because the resolver relied on inaccurate version
data in the helm release label

Signed-off-by: kevinrizza <krizza@redhat.com>
  • Loading branch information
kevinrizza committed Jul 8, 2024
1 parent 7cc9872 commit 235e3d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controllers/clusterextension_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
return ctrl.Result{}, err
}
case stateNeedsUpgrade:
rel, err = ac.Upgrade(ext.GetName(), ext.Spec.InstallNamespace, chrt, values, helmclient.AppendUpgradePostRenderer(post))
rel, err = ac.Upgrade(ext.GetName(), ext.Spec.InstallNamespace, chrt, values, func(upgrade *action.Upgrade) error {
upgrade.Labels = map[string]string{labels.BundleNameKey: bundle.Name, labels.PackageNameKey: bundle.Package, labels.BundleVersionKey: bundleVersion.String()}
return nil
}, helmclient.AppendUpgradePostRenderer(post))
if err != nil {
setInstalledStatusConditionFailed(ext, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonUpgradeFailed, err))
return ctrl.Result{}, err
Expand Down

0 comments on commit 235e3d4

Please sign in to comment.