-
Notifications
You must be signed in to change notification settings - Fork 65
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 config management with viper #395
Conversation
/gcbrun |
Pull Request Test Coverage Report for Build 5481146700
💛 - Coveralls |
d, err := newDeployment(args[0], false) | ||
if err != nil { | ||
return err | ||
} | ||
if err := d.Deploy(cmd.Context(), kubecfg); err != nil { | ||
d.Progress = viper.GetBool("progress") | ||
if err := d.Deploy(cmd.Context(), viper.GetString("kubecfg")); err != nil { |
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.
What happens if the GetString returns ""? It would be nice if this (and possibly other) values could be sanity checked prior to running these functions as then you don't have to worry about checking the values.
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.
this is the same behavior as the current implementation, if the flag was the empty string then the function call would handle it as before. in the case of kubecfg the empty string is completely valid as an argument if the user wants to fallback to the in cluster config.
kne_cli/main.go
Outdated
@@ -45,7 +45,8 @@ func main() { | |||
} | |||
} | |||
flags.Import() | |||
err := cmd.ExecuteContext(context.Background()) | |||
root := cmd.New() | |||
err := root.ExecuteContext(context.Background()) |
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.
You could just say cmd.New().ExecuteContext(...)
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
/gcbrun |
No description provided.