-
Notifications
You must be signed in to change notification settings - Fork 95
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
Refinery overwrites config settings by applying defaults after config was loaded #954
Comments
After our coding session today, I poked around at |
Opened an issue while still working on this creasty/defaults#49. |
Closed by #969. Upstream work creasty/defaults#50 and creasty/defaults#51. |
Followup worked to be done for 2.5 release described in #970. |
## Which problem is this PR solving? - #954 ## Short description of the changes - add a failing test to reproduce the problem - updated config struct fields that are bools defaulting to true to be bool pointers so that nil represents the unset state - updated getter functions to handle the pointers - [x] add a GetSamplerEnabled() function to HoneycombLoggerConfig to handle pointer defreferencing ## Maybe TODO - [ ] use something (reflect?) to do struct tag lookups to find default values in the getter functions instead of declaring defaults in multiple places - [ ] keep the default-true-bool-overridden-with-false test? - [ ] contribute documentation about bool pointer workaround to upstream defaults library? --------- Co-authored-by: Faith Chikwekwe <[email protected]> Co-authored-by: Faith Chikwekwe <[email protected]>
As seen in this section of code, Refinery is loading in defaults after the config has already been loaded in. This can result in user settings being reset to default. We need to apply defaults first and then load in the config to overwrite sections with user settings.
The text was updated successfully, but these errors were encountered: