From 7550e7296d33abf9e7e0383e5343320e118825c7 Mon Sep 17 00:00:00 2001 From: caretak3r <50377477+caretak3r@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:18:27 -0500 Subject: [PATCH] feat(release): store sequencing metadata in Release for rollback support - Add SequencingMetadata struct (enabled, strategy, batches) to Release - Persist subchart DAG batch order during ordered install - Enables rollback/uninstall to reconstruct original deployment order --- pkg/action/install.go | 7 +++++++ pkg/release/v1/release.go | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/pkg/action/install.go b/pkg/action/install.go index 0826f0b83..9d224d2bb 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -571,6 +571,13 @@ func (i *Install) performOrderedInstall(rel *release.Release, toBeAdopted kube.R return i.createAndWaitResources(toBeAdopted, resources) } + // Store sequencing metadata in the release for rollback/uninstall + rel.Sequencing = &release.SequencingMetadata{ + Enabled: true, + Strategy: string(kube.OrderedStrategy), + Batches: batches, + } + // Split the manifest by subchart subchartManifests := SplitManifestsBySubchart(rel.Manifest, rel.Chart.Metadata.Name) diff --git a/pkg/release/v1/release.go b/pkg/release/v1/release.go index 454ee6eb7..fc7cd1963 100644 --- a/pkg/release/v1/release.go +++ b/pkg/release/v1/release.go @@ -51,6 +51,22 @@ type Release struct { // ApplyMethod stores whether server-side or client-side apply was used for the release // Unset (empty string) should be treated as the default of client-side apply ApplyMethod string `json:"apply_method,omitempty"` // "ssa" | "csa" + // Sequencing stores metadata about ordered deployment used for this release. + // Nil when sequencing was not enabled (--wait=ordered not used). + // Used during rollback/uninstall to respect original deployment order. + Sequencing *SequencingMetadata `json:"sequencing,omitempty"` +} + +// SequencingMetadata stores the subchart deployment order used during install/upgrade. +// This allows rollback and uninstall operations to reconstruct the dependency graph. +type SequencingMetadata struct { + // Enabled indicates that ordered sequencing was used for this release. + Enabled bool `json:"enabled"` + // Strategy is the wait strategy used (e.g., "ordered"). + Strategy string `json:"strategy,omitempty"` + // Batches records the ordered deployment batches. + // Each batch is a list of subchart names deployed together. + Batches [][]string `json:"batches,omitempty"` } // SetStatus is a helper for setting the status on a release.