diff --git a/cmd/analyze/cli/root.go b/cmd/analyze/cli/root.go index 0ae16ac4d..eebc25275 100644 --- a/cmd/analyze/cli/root.go +++ b/cmd/analyze/cli/root.go @@ -1,7 +1,6 @@ package cli import ( - "fmt" "os" "strings" @@ -17,10 +16,11 @@ var ( func RootCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "analyze [url]", - Args: cobra.MinimumNArgs(1), - Short: "Analyze a support bundle", - Long: `Run a series of analyzers on a support bundle archive`, + Use: "analyze [url]", + Args: cobra.MinimumNArgs(1), + Short: "Analyze a support bundle", + Long: `Run a series of analyzers on a support bundle archive`, + SilenceUsage: true, PreRun: func(cmd *cobra.Command, args []string) { viper.BindPFlags(cmd.Flags()) }, @@ -49,7 +49,6 @@ func RootCmd() *cobra.Command { func InitAndExecute() { if err := RootCmd().Execute(); err != nil { - fmt.Println(err) os.Exit(1) } } diff --git a/cmd/preflight/cli/root.go b/cmd/preflight/cli/root.go index e33843e2c..88178c7ca 100644 --- a/cmd/preflight/cli/root.go +++ b/cmd/preflight/cli/root.go @@ -1,7 +1,6 @@ package cli import ( - "fmt" "os" "strings" @@ -22,6 +21,7 @@ func RootCmd() *cobra.Command { Short: "Run and retrieve preflight checks in a cluster", Long: `A preflight check is a set of validations that can and should be run to ensure that a cluster meets the requirements to run an application.`, + SilenceUsage: true, PreRun: func(cmd *cobra.Command, args []string) { viper.BindPFlags(cmd.Flags()) }, @@ -55,7 +55,6 @@ that a cluster meets the requirements to run an application.`, func InitAndExecute() { if err := RootCmd().Execute(); err != nil { - fmt.Println(err) os.Exit(1) } } diff --git a/cmd/troubleshoot/cli/root.go b/cmd/troubleshoot/cli/root.go index 66a608787..13cc9401c 100644 --- a/cmd/troubleshoot/cli/root.go +++ b/cmd/troubleshoot/cli/root.go @@ -1,7 +1,6 @@ package cli import ( - "fmt" "os" "strings" @@ -23,6 +22,7 @@ func RootCmd() *cobra.Command { Short: "Generate and manage support bundles", Long: `A support bundle is an archive of files, output, metrics and state from a server that can be used to assist when troubleshooting a server.`, + SilenceUsage: true, PreRun: func(cmd *cobra.Command, args []string) { viper.BindPFlags(cmd.Flags()) }, @@ -57,7 +57,6 @@ from a server that can be used to assist when troubleshooting a server.`, func InitAndExecute() { if err := RootCmd().Execute(); err != nil { - fmt.Println(err) os.Exit(1) } } diff --git a/go.mod b/go.mod index a3a8dcd94..3e2bdadfc 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,6 @@ require ( k8s.io/apimachinery v0.17.0 k8s.io/cli-runtime v0.17.0 k8s.io/client-go v0.17.0 - k8s.io/code-generator v0.16.5-beta.1 // indirect sigs.k8s.io/controller-runtime v0.4.0 ) diff --git a/go.sum b/go.sum index ab0b9e709..c28fe2291 100644 --- a/go.sum +++ b/go.sum @@ -184,7 +184,6 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodules/jsonpatch v2.0.1+incompatible h1:nSfpOMq/8sorBGIT4ilaor1CyPm3DB6saYgN4LCeKDY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -634,8 +633,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.17.0 h1:H9d/lw+VkZKEVIUc8F3wgiQ+FUXTTr21M87jXLU7yqM= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8 h1:q1Qvjzs/iEdXF6A1a8H3AKVFDzJNcJn3nXMs6R6qFtA= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783 h1:V6ndwCPoao1yZ52agqOKaUAl7DYWVGiXjV7ePA2i610= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= @@ -648,7 +645,6 @@ k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53 k8s.io/client-go v0.17.0 h1:8QOGvUGdqDMFrm9sD6IUFl256BcffynGoe80sxgTEDg= k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= -k8s.io/code-generator v0.16.5-beta.1/go.mod h1:mJUgkl06XV4kstAnLHAIzJPVCOzVR+ZcfPIv4fUsFCY= k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -668,8 +664,6 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -sigs.k8s.io/controller-runtime v0.2.0-alpha.0 h1:WM6lu3SNU4SsMlDYvjJyLsG9nW3ffb/4/FpE2ZGrtnc= -sigs.k8s.io/controller-runtime v0.2.0-alpha.0/go.mod h1:HFAYoOh6XMV+jKF1UjFwrknPbowfyHEHHRdJMf2jMX8= sigs.k8s.io/controller-runtime v0.4.0 h1:wATM6/m+3w8lj8FXNaO6Fs/rq/vqoOjO1Q116Z9NPsg= sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0=