From 014ba719c2aef060efee83f46755bf46bb03a4eb Mon Sep 17 00:00:00 2001 From: rohit <50377477+caretak3r@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:38:06 -0400 Subject: [PATCH] fix: Update pkg/action/sequencing.go avoid mis-matching charts nested in deeper paths Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: rohit <50377477+caretak3r@users.noreply.github.com> --- pkg/action/sequencing.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/action/sequencing.go b/pkg/action/sequencing.go index 1896da7e4..7089cabda 100644 --- a/pkg/action/sequencing.go +++ b/pkg/action/sequencing.go @@ -58,14 +58,13 @@ func GroupManifestsByDirectSubchart(manifests []releaseutil.Manifest, chartName chartsPrefix := chartName + "/charts/" for _, m := range manifests { - idx := strings.Index(m.Name, chartsPrefix) - if idx < 0 { + if !strings.HasPrefix(m.Name, chartsPrefix) { // Parent chart manifest result[""] = append(result[""], m) continue } // Extract the direct subchart name (first segment after "/charts/") - rest := m.Name[idx+len(chartsPrefix):] + rest := m.Name[len(chartsPrefix):] // rest is like "subchart1/templates/deploy.yaml" or "subchart1/charts/nested/..." slashIdx := strings.Index(rest, "/") if slashIdx < 0 {