feat(flux): support multiple yaml documents#8056
Merged
olblak merged 3 commits intoupdatecli:mainfrom Mar 21, 2026
Merged
Conversation
Signed-off-by: Olblak <[email protected]>
Contributor
There was a problem hiding this comment.
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, andOCIRepositorydefinitions across all documents. - Add
documentindexto 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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6200
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement