-
Notifications
You must be signed in to change notification settings - Fork 13
fix: Improve merge logic for parameterSecretRefs and parameters #375
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
base: main
Are you sure you want to change the base?
Conversation
|
@jn-av looks already promising ;) Let us know when its ready for review. |
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.
The logic looks great.
This is a single functions without dependencies, would be also a perfect opportunity to test this function itself without the ComplexParameterJson context.
This way it would also be easily visible what this function is expected to do, sort of usage example :)
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.
Excellent fix 🚀 with great test coverage. Good work!!
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.
Can only agree, great work!
📝 Description
Currently, the merge between
parameterSecretRefsandparametershappens at a high level.Since both objects contain a
datafield directly underneath, the values of these fields are simply overwritten rather than merged.This leads to cases where a single field (for example,
adminPassword) overwrites the entiredataobject, which is unintended and causes loss of existing values.💡 Proposed Change
Implement a recursive (deep) merge for these objects to ensure that:
✅ Benefits
parametersandparameterSecretRefsdefine overlapping keys.