-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(cli): make config create use the same file as config root #319
Conversation
bcc2a03
to
336c8a0
Compare
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.
while we're in initConfig
, could the viper.AutomaticEnvironment
call get moved next to where viper
parses the config file if present and before values are read out of viper
into the config = newConfig()
object?
there's something lurking about initConfig
that bothers me. encoding that the generated config file must be at the same location as the config file read by initConfig
is probably part of it, but i don't think that's the entire story..
.. that datamonFlags.context.Descriptor.Name
is set either by env variable or flag could be part of it, although i suspect it's a combination of things.
i could approve this as a piecemeal change as is, yet i'd like to see more done about the config story.
as usual, lmk if you'd prefer approval and an addendum merge request or discussion about how to evolve the extant work here.
3a05c9a
to
1477b6f
Compare
278f294
to
a4d3b67
Compare
…/.datamon2/datamon.yaml) * renamed config create source after actual command name * error handling * home dir retrieval using golang os builtin Signed-off-by: Frederic BIDON <[email protected]> fix(cli): only tolerates yaml CLI config file Signed-off-by: Frederic BIDON <[email protected]>
a4d3b67
to
9ace3d3
Compare
fix(cli): make config create use the same file as config root
(i.e. ~/.datamon2/datamon.yaml)
Signed-off-by: Frederic BIDON [email protected]