Handle a missing apiserver flag better.

This commit is contained in:
Brendan Burns 2014-12-09 16:20:47 -08:00
parent 121a291a0c
commit 1a5a7ebd69

View File

@ -17,6 +17,7 @@ limitations under the License.
package kubelet
import (
"fmt"
"net/http"
"os"
"os/exec"
@ -160,6 +161,9 @@ func getApiserverClient(authPath string, apiServerList util.StringList) (*client
if err != nil {
return nil, err
}
if len(apiServerList) < 1 {
return nil, fmt.Errorf("no apiservers specified.")
}
// TODO: adapt Kube client to support LB over several servers
if len(apiServerList) > 1 {
glog.Infof("Mulitple api servers specified. Picking first one")