-
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
Move MapProvider
interfaces to config/configmapprovider
package
#4337
Move MapProvider
interfaces to config/configmapprovider
package
#4337
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4337 +/- ##
=======================================
Coverage 88.67% 88.67%
=======================================
Files 176 176
Lines 10377 10377
=======================================
Hits 9202 9202
Misses 947 947
Partials 228 228
Continue to review full report at Codecov.
|
|
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 rebase, and update contrib before we can merge this.
@mx-psi same problem, after the other PR contrib is still unhappy. |
config/configmapprovider/default.go
Outdated
// defined by the given configFile and overwrites fields using properties. | ||
func NewDefaultMapProvider(configFileName string, properties []string) config.MapProvider { | ||
func NewDefaultMapProvider(configFileName string, properties []string) Provider { |
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.
s/NewDefaultMapProvider/NewDefault
What do you think?
config/configmapprovider/expand.go
Outdated
func NewExpandMapProvider(base config.MapProvider) config.MapProvider { | ||
// NewExpandMapProvider returns a Provider, that expands all environment variables for a | ||
// config.Map provided by the given Provider. | ||
func NewExpandMapProvider(base Provider) Provider { |
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.
s/NewExpandMapProvider/NewExpand?
What do you think? Same everywhere.
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.
NewFile
is the only one that may sound a bit weird, but in general it sounds better with your proposed change. Will do the change everywhere so that we see how it looks and can decide
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.
done. I think something like configmapprovider.NewFromFile
and similarly configmapprovider.NewFromProperties
sound better to me than configmapprovider.NewFile
or configmapprovider.NewProperties
(since the latter don't make it clear that you are creating a provider). What do you think?
Please fix windows tests:
|
@bogdandrutu ping (all tests passing and I merged main) |
Description:
Move MapProvider interfaces to
configmapprovider
.This is more consistent with other packages (e.g.
configunmarshaler
) and (probably) reduces the chance of dependency cyclesLink to tracking Issue: #4206 (comment)