Skip to content

fix(platform): bundle prologue swallows the document separator into the # Networking comment #2475

Description

Description

The top of packages/core/platform/templates/bundles/system.yaml is:

# Networking
{{- if eq .Values.bundles.system.variant "isp-full" }}
{{include "cozystack.platform.package" (list "cozystack.networking" "kubeovn-cilium" $ $networkingComponents) }}
...

The {{- strips the newline after # Networking, and the first --- that the Package helper emits lands on the same line as the comment, producing # Networking---. YAML parses that as a pure comment — the document separator is lost.

Why it matters

Today it works because the isp-full variant block itself emits the first Package and there is nothing to collide with. The fragility only surfaces when a new Package include is added immediately before the # Networking line: the first emitted Package document's apiVersion merges into the previous Package's output and Flux's post-renderer fails with mapping key "apiVersion" already defined.

Hit this while adding a cozystack.gateway-api-crds include at the top of the bundle for #2470. I worked around it by moving the include into the Common Packages block, but the root cause is still there.

Fix options

  • Remove the left-dash on {{- if eq .Values.bundles.system.variant ...}} so the comment's trailing newline is preserved.
  • Emit an explicit --- line at the start of every Package helper's output.

Either fix is small. The first is less invasive; the second is defensive for any future include reshuffling.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    on Apr 24, 2026
  2. added
    area/platformIssues or PRs related to platform infrastructure (bundle, flux, talos, installer)
    priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete
    triage/acceptedIndicates an issue is ready to be actively worked on
    on Apr 27, 2026
  3. dosubot commented on Jul 27, 2026

    @dosubot

    Hi, Aleksei Sviridkin (@lexfrei). I'm Dosu, and I'm helping the cozystack team manage their backlog and am marking this issue as stale.

    Issue Summary

    • A left-trimmed Go template tag in packages/core/platform/templates/bundles/system.yaml can cause the # Networking comment to consume the first --- document separator.
    • When that happens, YAML no longer recognizes the document boundary, which can lead to Flux post-rendering failures.
    • The failure mode appears fragile and can be triggered by adding new package includes before that line, resulting in duplicate apiVersion keys.
    • The suggested fix is to remove the - from {{- if ... }} or ensure the package helper always emits an explicit ---.

    Next Steps

    • Please let us know if this is still relevant on the latest version of the cozystack repository.
    • If it is still reproducible, you can keep the discussion open by commenting here; otherwise, this issue will be automatically closed in 7 days.

    Thanks for your understanding and contribution.

  4. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale
    and removed on Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/platformIssues or PRs related to platform infrastructure (bundle, flux, talos, installer)kind/bugCategorizes issue or PR as related to a buglifecycle/staleDenotes an issue or PR has remained open with no activity and has become stalepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions