fix(hip-0025): show unresolved subchart batches in dag; hoist annotation keys

Address Copilot review on PR #32038:
- dag.go: printChild returned early for subcharts whose chart metadata is
  unavailable (storage-decoded charts at rollback/uninstall), hiding the
  structural resource-group batches buildStructuralLevel generates. Print
  an accurate note and still recurse into the structural child level. The
  old 'not found in chart dependencies' message was also misleading.
- sequencing.go: hoist HelmInternalSequencingAnnotations() out of the
  per-resource Visit closure so the slice is cloned once per batch.
pull/32038/head
Rohit Gudi 15 hours ago
parent 1ab51f309c
commit 9cd32c1e91
No known key found for this signature in database
GPG Key ID: 4D9E5BA7BBE1EB29

@ -201,6 +201,7 @@ func (s *sequencedDeployment) applyBatch(ctx context.Context, batch sequence.Bat
// resources before they are applied to Kubernetes. This prevents K8s API
// validation errors for annotation keys that are not valid K8s label keys.
func stripSequencingAnnotations(resources kube.ResourceList) error {
sequencingKeys := releaseutil.HelmInternalSequencingAnnotations()
return resources.Visit(func(info *resource.Info, err error) error {
if err != nil {
return err
@ -214,7 +215,7 @@ func stripSequencingAnnotations(resources kube.ResourceList) error {
return nil
}
changed := false
for _, key := range releaseutil.HelmInternalSequencingAnnotations() {
for _, key := range sequencingKeys {
if _, exists := annotations[key]; exists {
delete(annotations, key)
changed = true

@ -194,8 +194,7 @@ func printSequencingDAG(chrt *chart.Chart, manifest string, out io.Writer) error
printChild := func(name string) {
if slices.Contains(level.Unresolved, name) {
fmt.Fprintf(out, "%s (subchart %q not found in chart dependencies)\n", indent, name)
return
fmt.Fprintf(out, "%s (subchart %q metadata unavailable; sequenced structurally from manifests)\n", indent, name)
}
if child := levelByPath[level.Path+"/charts/"+name]; child != nil {
printLevel(child)

Loading…
Cancel
Save