Merge pull request #37442 from NickrenREN/kubelet-run

Automatic merge from submit-queue (batch tested with PRs 37094, 37663, 37442, 37808, 37826)

fix if condition question in kubelet run() function

Here variable err returned by function NewForConfig(&eventClientConfig) if CreateAPIServerClientConfig() function runs correctly .  And we should not print "invalid kubeconfig" info.
Should we use else instead of if.
This commit is contained in:
Kubernetes Submit Queue 2016-12-03 04:27:50 -08:00 committed by GitHub
commit caa935df45

View File

@ -392,8 +392,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
eventClientConfig.QPS = float32(s.EventRecordQPS)
eventClientConfig.Burst = int(s.EventBurst)
eventClient, err = clientset.NewForConfig(&eventClientConfig)
}
if err != nil {
} else {
if s.RequireKubeConfig {
return fmt.Errorf("invalid kubeconfig: %v", err)
}