Skip to content

feat: support multi-document YAML asset files #151

@tiraboschi

Description

@tiraboschi

Assets are currently modeled as 1 file -> 1 Kubernetes object. Multi-doc YAML files (separated by ---) are silently truncated to the first document today.
The low-level plumbing already exists (ParseMultiYAML, RenderMultiAsset), but the reconciliation path (patcher, output, debug handlers) always calls RenderAsset which returns a single object.

Proposed approach

Auto-detect multi-doc files at registry load time by counting non-empty documents after splitting on ---.
No flag or metadata change needed.
When more than one document is found, the patcher dispatches to RenderMultiAsset and applies each object individually.

Work items

  • Auto-detect multi-doc in the registry/loader at load time
  • Update patcher.go, output.go, and debug handlers to dispatch accordingly
  • Tombstone tracking for each object in a multi-doc asset
  • Tests with a multi-doc fixture (static YAML and template)

Open questions

  • Tombstone tracking: each object in a multi-doc asset needs independent lifecycle management. The current tombstone model is 1 asset -> 1 object; it's unclear how to handle partial removal (e.g. one document is removed from a file while others remain) without introducing significant complexity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions