mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-03 23:40:03 +00:00 
			
		
		
		
	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:
		@@ -18,6 +18,7 @@ package main
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	goflag "flag"
 | 
						goflag "flag"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/spf13/pflag"
 | 
						"github.com/spf13/pflag"
 | 
				
			||||||
@@ -42,6 +43,7 @@ func main() {
 | 
				
			|||||||
	defer logs.FlushLogs()
 | 
						defer logs.FlushLogs()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := command.Execute(); err != nil {
 | 
						if err := command.Execute(); err != nil {
 | 
				
			||||||
 | 
							fmt.Fprintf(os.Stderr, "error: %v\n", err)
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ limitations under the License.
 | 
				
			|||||||
package main
 | 
					package main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"k8s.io/kubernetes/cmd/kubeadm/app"
 | 
						"k8s.io/kubernetes/cmd/kubeadm/app"
 | 
				
			||||||
@@ -24,6 +25,7 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
	if err := app.Run(); err != nil {
 | 
						if err := app.Run(); err != nil {
 | 
				
			||||||
 | 
							fmt.Fprintf(os.Stderr, "error: %v\n", err)
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	os.Exit(0)
 | 
						os.Exit(0)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ limitations under the License.
 | 
				
			|||||||
package main
 | 
					package main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"k8s.io/kubernetes/cmd/kubectl/app"
 | 
						"k8s.io/kubernetes/cmd/kubectl/app"
 | 
				
			||||||
@@ -24,6 +25,7 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
	if err := app.Run(); err != nil {
 | 
						if err := app.Run(); err != nil {
 | 
				
			||||||
 | 
							fmt.Fprintf(os.Stderr, "error: %v\n", err)
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	os.Exit(0)
 | 
						os.Exit(0)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user