Flux Autodiscovery Doesn't discover some HelmRelease #6200#7641
Open
josill wants to merge 6 commits intoupdatecli:mainfrom
Open
Flux Autodiscovery Doesn't discover some HelmRelease #6200#7641josill wants to merge 6 commits intoupdatecli:mainfrom
josill wants to merge 6 commits intoupdatecli:mainfrom
Conversation
df7c946 to
30e9565
Compare
30e9565 to
a93a823
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Flux autodiscovery to properly handle multi-document YAML files containing multiple HelmRelease resources. Previously, only the first HelmRelease in a multi-document file would be discovered, causing subsequent resources to be ignored.
Changes:
- Refactored HelmRelease manifest discovery to process each document in multi-document YAML files separately
- Added tracking flags to prevent duplicate file paths when multiple resources exist in one file
- Added comprehensive test coverage for multi-document YAML files
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/plugins/autodiscovery/flux/helmreleaseManifests.go | Refactored to read files once, split by YAML document separator, and process each HelmRelease document individually |
| pkg/plugins/autodiscovery/flux/helmrelease.go | Removed unused loadHelmRelease() function that only handled single documents |
| pkg/plugins/autodiscovery/flux/utils.go | Added tracking flags to prevent adding the same file path multiple times when multiple HelmRelease or OCIRepository documents exist in one file |
| pkg/plugins/autodiscovery/flux/testdata/helmrelease/multi-release/multi-helmrelease.yaml | Test data with three documents: two HelmRelease resources and one HelmRepository |
| pkg/plugins/autodiscovery/flux/main_test.go | Added test case validating that two separate manifests are generated for the multi-document file |
| pkg/plugins/autodiscovery/flux/utils_test.go | Updated to include the new multi-release test file in expected results |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
olblak
reviewed
Feb 6, 2026
| name: 'deps(flux): bump Helmrelease "udash"' | ||
| kind: 'yaml' | ||
| spec: | ||
| file: 'multi-helmrelease.yaml' |
Member
There was a problem hiding this comment.
The target is missing the parameter documentindex to define where document Updatecli should update
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
This PR fixes Flux autodiscovery to properly handle multi-document YAML files containing multiple HelmRelease resources. Previously,
discoverHelmreleaseManifests()would only process the first document in a multi-document YAML file, causing subsequent HelmRelease resources to be ignored.Changes
Refactored
discoverHelmreleaseManifests()(pkg/plugins/autodiscovery/flux/helmreleaseManifests.go):bytes.Split()loadHelmReleaseFromBytes()Fixed duplicate file path issue in
searchFluxFiles()(pkg/plugins/autodiscovery/flux/utils.go):Added comprehensive test case (
pkg/plugins/autodiscovery/flux/testdata/helmrelease/multi-release/):TestSearchFluxFilesto include the new test fileTest
To test this pull request, you can run the following commands:
Or to run the specific multi-document test case:
Additional Information
Checklist
Tradeoff
Potential improvement
searchFluxFiles()anddiscoverHelmreleaseManifests()now use the same pattern