mirror of https://github.com/k3s-io/k3s
Merge pull request #46276 from karataliu/removeDupMsg
Automatic merge from submit-queue (batch tested with PRs 47961, 46276) Remove duplicate error message output in hyperkube. **What this PR does / why we need it**: Currently hyperkube binary will always print duplicate messages if fatal error occurs: ``` $ ./kubelet # run without permission I0523 08:38:02.642638 25701 feature_gate.go:144] feature gates: map[] W0523 08:38:02.642827 25701 server.go:472] No API client: no api servers specified Error: failed to run Kubelet: error reading /var/run/kubernetes/kubelet.key, certificate and key must be supplied as a pair Error: failed to run Kubelet: error reading /var/run/kubernetes/kubelet.key, certificate and key must be supplied as a pair ``` This is due to RunToExit will print out the error which Run has just printed. https://github.com/kubernetes/kubernetes/blob/8bee44b/cmd/hyperkube/hyperkube.go#L178-L189 This was introduced in following commit for adding GOMAXPROCS calls.pull/6/head1e679f0069
The following commit removes GOMAXPROCS calls, but did not remove the corresponding error output line.88ea80b572
**Which issue this PR fixes** **Special notes for your reviewer**: **Release note**:
commit
637cc0a8ba
|
@ -186,7 +186,6 @@ func (hk *HyperKube) Run(args []string) error {
|
|||
func (hk *HyperKube) RunToExit(args []string) {
|
||||
err := hk.Run(args)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(0)
|
||||
|
|
Loading…
Reference in New Issue