Merge pull request #50887 from netroby/patch-1

Automatic merge from submit-queue (batch tested with PRs 55016, 50887). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

If command.Execute() return err, print to stdErr

The current kube-proxy not print error if (execute() failed) . not so good and not so friendly to user.
If print err to stdError, will show us why it failed.
This commit is contained in:
Kubernetes Submit Queue 2017-11-02 15:40:15 -07:00 committed by GitHub
commit 9c41f9baf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@ package main
import (
goflag "flag"
"fmt"
"os"
"github.com/spf13/pflag"
@ -42,6 +43,7 @@ func main() {
defer logs.FlushLogs()
if err := command.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package main
import (
"fmt"
"os"
"k8s.io/kubernetes/cmd/kubeadm/app"
@ -24,6 +25,7 @@ import (
func main() {
if err := app.Run(); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
os.Exit(0)

View File

@ -17,6 +17,7 @@ limitations under the License.
package main
import (
"fmt"
"os"
"k8s.io/kubernetes/cmd/kubectl/app"
@ -24,6 +25,7 @@ import (
func main() {
if err := app.Run(); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
os.Exit(0)