-
-
Notifications
You must be signed in to change notification settings - Fork 99
feat: support multiple yaml keys for 1 target #5696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the PR. |
There was a problem hiding this comment.
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 implements support for multiple YAML keys in targets, allowing users to update multiple paths in YAML files with a single value. This addresses issue #1056 by introducing a new Keys
field that accepts an array of key paths.
Key changes include:
- Added
Keys
field to the Spec struct as an alternative to the singleKey
field - Modified target logic to process multiple keys sequentially for each file
- Enhanced validation to ensure
Key
andKeys
are mutually exclusive and prevent duplicates
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
pkg/plugins/resources/yaml/main.go | Added Keys field, validation logic, and helper methods |
pkg/plugins/resources/yaml/target.go | Modified target functions to iterate over multiple keys |
pkg/plugins/resources/yaml/target_test.go | Added comprehensive test cases for multiple key scenarios |
pkg/plugins/resources/yaml/main_test.go | Added validation tests for the new Keys field |
pkg/plugins/resources/yaml/source_test.go | Added missing Key field to fix existing test |
pkg/plugins/resources/yaml/condition_test.go | Added missing Key field to fix existing test |
Fix #1056
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement
Note - This code is generated by GitHub Copilot