Exclude fn-config from function input items in kpt fn eval#4639
Open
aravindtga wants to merge 2 commits into
Open
Exclude fn-config from function input items in kpt fn eval#4639aravindtga wants to merge 2 commits into
aravindtga wants to merge 2 commits into
Conversation
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes kpt fn eval behavior when --fn-config points to a file inside the package, ensuring the fn-config resource is not included in resourceList.items (so functions don’t accidentally mutate their own configuration) while still preserving the file on disk.
Changes:
- Excludes the fn-config resource from function input items when it resides inside the package, and re-adds it to outputs so it isn’t deleted.
- Adds a unit test covering fn-config exclusion behavior.
- Updates e2e expected outputs and CLI documentation to reflect the new semantics.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| thirdparty/kyaml/runfn/runfn.go | Filters fn-config out of function input items and ensures it is written back unmodified. |
| thirdparty/kyaml/runfn/runfn_test.go | Adds a unit test for fn-config exclusion/preservation behavior. |
| e2e/testdata/fn-eval/save-fn/custom-pkg-path/.expected/diff.patch | Updates expected patch output so fn-config is no longer modified. |
| e2e/testdata/fn-eval/save-fn/custom-pkg-path/.expected/config.yaml | Updates expected results summary counts after fn-config exclusion. |
| documentation/content/en/reference/cli/fn/eval/_index.md | Documents that fn-config is not treated as an input resource and won’t be modified. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
aravindtga
marked this pull request as ready for review
July 16, 2026 13:52
aravindtga
requested review from
efiacor,
kispaljr,
liamfallon and
mozesl-nokia
as code owners
July 16, 2026 13:52
mozesl-nokia
approved these changes
Jul 16, 2026
Contributor
|
Just wondering if this is the intended behaviour. Not sure myself |
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.
Description
--fn-configpoints to a file inside the package, the fn-config resource is now excluded from the function's input items inkpt fn eval. The file is preserved unmodified on disk.fn-configwas being passed to the function both asresourceList.functionConfigand as one ofresourceList.items, causing functions likecreate-settersandset-namespaceto modify their own configuration file.FnConfigPathand removed frominputResources. It is added back unmodified tooutputResourcesbefore writing so the file is not deleted from disk.Related Issue(s)
Type of Change
Checklist
AI Disclosure
If so, please describe how:
- Kiro to analyse the issue, implement the fix, and generate unit tests.