-
Notifications
You must be signed in to change notification settings - Fork 38
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
Reject configuration with unknown fields #2981
Reject configuration with unknown fields #2981
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2981 +/- ##
==========================================
+ Coverage 22.88% 23.12% +0.23%
==========================================
Files 785 788 +3
Lines 58806 58912 +106
==========================================
+ Hits 13457 13622 +165
+ Misses 44469 44407 -62
- Partials 880 883 +3 ☔ View full report in Codecov by Sentry. |
3918309
to
69ecefa
Compare
There was a problem that the default value of the list was a slice with a length of 0, so I added a check for this. And now my devenv works. |
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 this be solved with https://pkg.go.dev/github.com/spf13/viper#UnmarshalExact?
Partially it can, but there are such fields in the config, for example, |
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
69ecefa
to
652e230
Compare
Because of nspcc-dev/neofs-node#2981, now the config is being validated, and some fields need to be corrected in the tests. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Closes #2663, #1950.
The problems I have encountered:
grpc
section with list of structures andnode
section with unlimited number of attributes..env
files are not being processed, because of the work of theviper
package. Should I do it? It might be more difficult.