-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Remove component.UnmarshalConfig #7102
Comments
@gbbr when I say "remove" it means doing the correct "deprecation" process that we have in place for this repo. |
I have checked all Lastly, why is What do you think about going down this path? |
…g configuration (#9154) **Description:** Make the option `WithErrorUnused` enabled by default when unmarshaling configuration The option `WithErrorUnused` is now enabled by default, and a new option `WithIgnoreUnused` is introduced to ignore errors about unused fields. **Link to tracking Issue:** This relates to #7102 to some extent. **Testing:** N/A **Documentation:** N/A
@atoulme this change in Get the following error
Is there any other change needed to not error on extra keys? This used to work for |
You use a nested struct which needs to change the way it unmarshals to set You should not change your test for this. |
**Description:** This PR removes the top level if/else in `component.UnmarshalConfig`, handling recursive state in the confmap.Conf object instead. This PR deprecates `component.UnmarshalConfig` in favor of calling directly `Unmarshal` on the confmap.Conf object. **Link to tracking Issue:** Fixes #7102 Fixes #7101 --------- Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
#### Description Remove deprecated `component.UnmarshalConfig` #### Link to tracking issue Fixes #7102 Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
**Description:** This PR removes the top level if/else in `component.UnmarshalConfig`, handling recursive state in the confmap.Conf object instead. This PR deprecates `component.UnmarshalConfig` in favor of calling directly `Unmarshal` on the confmap.Conf object. **Link to tracking Issue:** Fixes open-telemetry#7102 Fixes open-telemetry#7101 --------- Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
There are mostly historical reasons why this exists, but we should clean this. Here are few options:
confmap.Unmarshal
equivalent withcomponent.UnmarshalConfig
. Few caveats here:Unmarshaler
andMarshaler
#7101 which kind of require to have a separate func outside of Conf to avoid the circular call.ErrorUnused
enable by default.Unmarshaler
andMarshaler
#7101 and default enableErrorUnused
. This will become super clean, the Conf.Unmarshal can be used, offers options for customizations, etc.The text was updated successfully, but these errors were encountered: