-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[xconfmap] Create module and add validation facilities #12226
[xconfmap] Create module and add validation facilities #12226
Conversation
#12224 is merged, so this PR only contains relevant changes now. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12226 +/- ##
==========================================
+ Coverage 91.27% 91.31% +0.03%
==========================================
Files 466 467 +1
Lines 25583 25711 +128
==========================================
+ Hits 23351 23477 +126
- Misses 1816 1818 +2
Partials 416 416 ☔ View full report in Codecov by Sentry. |
aa1b14c
to
65dd4cd
Compare
…date
const ( | ||
// MapstructureTag is the struct field tag used to record marshaling/unmarshaling settings. | ||
// See https://pkg.go.dev/github.com/go-viper/mapstructure/v2 for supported values. | ||
MapstructureTag = "mapstructure" |
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.
We could just hardcode the tag name in xconfmap
for now, but I figure it's a good time to make this an exported constant.
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.
We could also move this to an confmap/internal
package I guess, if we want to avoid exposing this
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR is to unblock `make update-otel` in contrib repo cc @evan-bradley @mx-psi <!-- Issue number if applicable --> #### Link to tracking issue Relevant #12226 <!--Describe what testing was performed and which tests were added.--> #### Testing n/a <!--Describe the documentation added.--> #### Documentation n/a <!--Please delete paragraphs that you did not use before submitting.-->
Description
Builds on #12224 and starts the move of config validation from component to confmap. We can keep this in
xconfmap
while we determine whether to add the ability to validate using struct field tags.I think this has the following advantages:
The one uncertainty this creates is what to do withcomponent.Config
, which would now be used as a thin alias forany
without any meaningful usage in component.Link to tracking issue
Fixes #11524