Repository navigation
fix(appset): parse a child generator selector after interpolation (#17610) - #31245
Indian-boult wants to merge 1 commit into
Conversation
…goproj#17610) Transform interpolates the second generator of a matrix with the first generator's params, but it parsed the post selector from the raw spec and filtered with that. A selector that used those params either failed to parse, which failed the whole ApplicationSet, or never matched, so Applications were silently left out. The selector is now parsed from the interpolated generator. Signed-off-by: Neeraj Khatri <neeraj.khatri.work@gmail.com>
❗ Preview Environment deployment failed on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #31245 +/- ##
==========================================
+ Coverage 73.69% 73.70% +0.01%
==========================================
Files 444 444
Lines 58261 58261
==========================================
+ Hits 42936 42943 +7
+ Misses 15325 15318 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Fixes #17610
Transformingenerator_spec_processor.gointerpolates the second generator of a matrix with the params of the first one, but it parsed the post selector from the raw spec before that and filtered with it afterwards. A templated key such asenabledIn.{{ .env }}failed to parse as a label key, which failed the whole ApplicationSet with the error in the issue. A templated value parsed but never matched, so Applications were left out with no error.The selector is now parsed from the interpolated generator, right before the params are generated and filtered. Generators that get no params from a matrix are not interpolated, so their selectors work as before.
TestTransformInterpolatesSelectorWithMatrixParamscovers a templated key, a templatedmatchExpressionsvalue and a templatedmatchLabelsvalue. All three cases fail on master and pass with this change. I ran allapplicationset/...tests,go build ./..., and golangci-lint v2.15.0 onapplicationset/..., which reports no new issues. I did not run the full root test suite locally.#22266 and #22267 edit the same file for nested matrix generators, #22051, which is a different bug.
The same code is in release-3.4, release-3.5 and release-3.6.
Checklist:
Summary by CodeRabbit