mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Handle a missing apiserver flag better.
This commit is contained in:
parent
121a291a0c
commit
1a5a7ebd69
@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package kubelet
|
package kubelet
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@ -160,6 +161,9 @@ func getApiserverClient(authPath string, apiServerList util.StringList) (*client
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if len(apiServerList) < 1 {
|
||||||
|
return nil, fmt.Errorf("no apiservers specified.")
|
||||||
|
}
|
||||||
// TODO: adapt Kube client to support LB over several servers
|
// TODO: adapt Kube client to support LB over several servers
|
||||||
if len(apiServerList) > 1 {
|
if len(apiServerList) > 1 {
|
||||||
glog.Infof("Mulitple api servers specified. Picking first one")
|
glog.Infof("Mulitple api servers specified. Picking first one")
|
||||||
|
Loading…
Reference in New Issue
Block a user