-
Notifications
You must be signed in to change notification settings - Fork 430
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
[Config CLI Parity] add squash to config structure tags to make decoding easier #2044
[Config CLI Parity] add squash to config structure tags to make decoding easier #2044
Conversation
…gacy flagStorage & mountConfig.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2044 +/- ##
==========================================
+ Coverage 71.46% 71.52% +0.06%
==========================================
Files 99 99
Lines 10800 10800
==========================================
+ Hits 7718 7725 +7
+ Misses 2735 2728 -7
Partials 347 347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Please verify that the logic works for two levels of nesting. As per this, if a structure is not nested, that's when we can include the embedded struct to the tag value. It doesn't explicitly talk about the case where the struct is nested.
Verified that it is working for nested structs too |
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.
Relying on Kislay's review.
Description
Add "squash" to config structure tags to make decoding easier from legacy flagStorage & mountConfig.
This is a temporary change to make transition easier to new CLI and config flags and will be reverted post transition.
Reason to revert this in future - This change doesn't allow having leaf config with conflicting names.
Reference: https://pkg.go.dev/github.com/mitchellh/mapstructure#hdr-Embedded_Structs_and_Squashing
Open issue on mapstructure library which is blocking the change: mitchellh/mapstructure#356
Link to the issue in case of a bug fix.
NA
Testing details