forked from LaconicNetwork/kompose
cleanup debug logs & remove duplicated output (#1348)
* cleanup debug logs * avoid duplicate error messages and this makes main.go use os and fmt package instead of log to avoid touching global state
This commit is contained in:
+4
-5
@@ -49,14 +49,14 @@ var (
|
||||
|
||||
// RootCmd root level flags and commands
|
||||
var RootCmd = &cobra.Command{
|
||||
Use: "kompose",
|
||||
Short: "A tool helping Docker Compose users move to Kubernetes",
|
||||
Long: `Kompose is a tool to help users who are familiar with docker-compose move to Kubernetes.`,
|
||||
Use: "kompose",
|
||||
Short: "A tool helping Docker Compose users move to Kubernetes",
|
||||
Long: `Kompose is a tool to help users who are familiar with docker-compose move to Kubernetes.`,
|
||||
SilenceErrors: true,
|
||||
// PersistentPreRun will be "inherited" by all children and ran before *every* command unless
|
||||
// the child has overridden the functionality. This functionality was implemented to check / modify
|
||||
// all global flag calls regardless of app call.
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
// Add extra logging when verbosity is passed
|
||||
if GlobalVerbose {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
@@ -81,7 +81,6 @@ var RootCmd = &cobra.Command{
|
||||
if provider != "kubernetes" && provider != "openshift" {
|
||||
log.Fatalf("%s is an unsupported provider. Supported providers are: 'kubernetes', 'openshift'.", GlobalProvider)
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user