-
Notifications
You must be signed in to change notification settings - Fork 31
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
add support for specifying course file via environment variable #536
Conversation
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.
It strikes me as I read this that validating the args probably never belonged in the reckoner
package. Since we are, as the name implies, validating command line arguments, I think that all belongs in the cmd
package. That would probably make testing easier and decrease the size of the very large reckoner package since this code doesn't really make sense there.
Once moved into the cmd
package they don't need to be capitalized (exported) since they can be private functions at that point.
I have a couple other comments in-line that are less critical.
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.
One small fix in klog version so we aren't re-introducing the old version. Other than that it all looks great, thanks!
Co-authored-by: Luke Reed <luke@lreed.net>
All set! |
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.
LGTM, thank you! 🎉
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This PR fixes #503
Description
What's the goal of this PR?
To be able to configure the path to course.yml via environment variable. This avoids passing a path on the command line at every invocation, which will help with automation and possibly usability in single-cluster environments.
In addition, I've added a default path of
course.yml
to the courseFile. This should further help reduce typing if you're in the same directory as a course.yml (assuming it's named that).What changes did you make?
cmd/root.go now handles course file setting precedence. This should be global to all instances of setting courseFile, not just any particular subcommand (eg, it applies to
plot
,convert
,template
, etc).What alternative solution should we consider, if any?
Using viper to handle configuration overrides at various levels. However, that's a much larger change.