Skip to content

feat(flux): support multiple yaml documents#8056

Merged
olblak merged 3 commits into
updatecli:mainfrom
olblak:issue/6200
Mar 21, 2026
Merged

feat(flux): support multiple yaml documents#8056
olblak merged 3 commits into
updatecli:mainfrom
olblak:issue/6200

Conversation

@olblak

@olblak olblak commented Mar 21, 2026

Copy link
Copy Markdown
Member

Fix #6200

Test

To test this pull request, you can run the following commands:

cd pkg/plugins/autodiscovery/flux/
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the enhancement New feature or request label Mar 21, 2026
@olblak olblak requested a review from Copilot March 21, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Flux autodiscovery plugin to correctly handle multi-document YAML files (e.g., multiple HelmRelease / HelmRepository resources separated by ---), addressing issue #6200 where some Flux resources were not discovered.

Changes:

  • Parse Flux YAML files as multi-document streams and discover HelmRelease, HelmRepository, and OCIRepository definitions across all documents.
  • Add documentindex to generated autodiscovery manifests so Updatecli targets the correct YAML document.
  • Expand test coverage with new multi-document fixtures and updated expectations.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/plugins/autodiscovery/flux/utils.go Updates file scanning to use new multi-doc loaders for Flux resources.
pkg/plugins/autodiscovery/flux/helmrelease.go Reworks HelmRelease loading to read multi-document YAML.
pkg/plugins/autodiscovery/flux/helmrepository.go Adds multi-document HelmRepository loading.
pkg/plugins/autodiscovery/flux/ocirepository.go Reworks OCIRepository loading to read multi-document YAML.
pkg/plugins/autodiscovery/flux/helmreleaseManifests.go Generates one manifest per HelmRelease document and emits documentindex.
pkg/plugins/autodiscovery/flux/ociRepositoryManifests.go Generates one manifest per OCIRepository document and emits documentindex.
pkg/plugins/autodiscovery/flux/helmreleaseManifestTemplate.go Adds documentindex to HelmRelease condition/target specs.
pkg/plugins/autodiscovery/flux/ociRepositoryManifestTemplate.go Adds documentindex to OCIRepository target specs.
pkg/plugins/autodiscovery/flux/main_test.go Adjusts expectations and adds coverage for multi-document HelmRelease scenarios.
pkg/plugins/autodiscovery/flux/utils_test.go Ensures multi-doc HelmRelease YAML is included in discovered files.
pkg/plugins/autodiscovery/flux/testdata/helmrelease/multi-release/multi-helmrelease.yaml New multi-document test fixture with two HelmReleases + one HelmRepository.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/plugins/autodiscovery/flux/utils.go
Comment thread pkg/plugins/autodiscovery/flux/helmrelease.go Outdated
Comment thread pkg/plugins/autodiscovery/flux/ocirepository.go Outdated
Comment thread pkg/plugins/autodiscovery/flux/helmreleaseManifests.go
Comment thread pkg/plugins/autodiscovery/flux/ociRepositoryManifests.go
Comment thread pkg/plugins/autodiscovery/flux/utils.go Outdated
Comment thread pkg/plugins/autodiscovery/flux/utils.go
olblak and others added 2 commits March 21, 2026 15:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@olblak olblak enabled auto-merge (squash) March 21, 2026 14:50
@olblak olblak merged commit 322fa53 into updatecli:main Mar 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flux Autodiscovery Doesn't discover some HelmRelease

2 participants