Fix: change not to print error log on RunE

This commit is contained in:
sanposhiho 2021-10-04 01:35:17 +09:00
parent f80ddac1bc
commit c169d4d4d2

View File

@ -480,18 +480,15 @@ with the apiserver API to configure the proxy.`,
cliflag.PrintFlags(cmd.Flags()) cliflag.PrintFlags(cmd.Flags())
if err := initForOS(opts.WindowsService); err != nil { if err := initForOS(opts.WindowsService); err != nil {
klog.ErrorS(err, "Failed OS init") return fmt.Errorf("failed os init: %w", err)
return err
} }
if err := opts.Complete(); err != nil { if err := opts.Complete(); err != nil {
klog.ErrorS(err, "Failed complete") return fmt.Errorf("failed complete: %w", err)
return err
} }
if err := opts.Validate(); err != nil { if err := opts.Validate(); err != nil {
klog.ErrorS(err, "Failed validate") return fmt.Errorf("failed validate: %w", err)
return err
} }
if err := opts.Run(); err != nil { if err := opts.Run(); err != nil {
@ -501,8 +498,6 @@ with the apiserver API to configure the proxy.`,
return nil return nil
}, },
SilenceUsage: true,
SilenceErrors: true,
Args: func(cmd *cobra.Command, args []string) error { Args: func(cmd *cobra.Command, args []string) error {
for _, arg := range args { for _, arg := range args {
if len(arg) > 0 { if len(arg) > 0 {