From be5f0d764c5354393db9f1e1745697374d442d22 Mon Sep 17 00:00:00 2001 From: Matteo Gastaldello Date: Wed, 25 Feb 2026 16:23:35 +0100 Subject: [PATCH] fix: add rollback support for pending rollback state in Observe function --- internal/composition/composition.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/composition/composition.go b/internal/composition/composition.go index af879d9..8487e1a 100644 --- a/internal/composition/composition.go +++ b/internal/composition/composition.go @@ -179,11 +179,12 @@ func (h *handler) Observe(ctx context.Context, mg *unstructured.Unstructured) (c }, nil } - if rel.Status == helmconfig.StatusPendingInstall || rel.Status == helmconfig.StatusPendingUpgrade { + if rel.Status == helmconfig.StatusPendingInstall || rel.Status == helmconfig.StatusPendingUpgrade || rel.Status == helmconfig.StatusPendingRollback { log.Debug("Composition stuck install or upgrade in progress. Rolling back to previous release before re-attempting.") // Rollback to previous release rel, err = hc.Rollback(ctx, releaseName, &helmconfig.RollbackConfig{ - MaxHistory: helmMaxHistory, + MaxHistory: helmMaxHistory, + ReleaseVersion: rel.Revision, }) if err != nil { return controller.ExternalObservation{}, fmt.Errorf("rolling back release: %w", err)