Updating methods to return error rather than using glog.Fatalf

This commit is contained in:
nikhiljindal
2016-02-03 14:26:11 -08:00
parent 2aa28c6553
commit c7beb9078c
16 changed files with 128 additions and 38 deletions

View File

@@ -135,7 +135,11 @@ func startMasterOrDie(masterConfig *master.Config) (*master.Master, *httptest.Se
masterConfig.EnableProfiling = true
masterConfig.EnableSwaggerSupport = true
}
m = master.New(masterConfig)
m, err := master.New(masterConfig)
if err != nil {
glog.Fatalf("error in bringing up the master: %v", err)
}
return m, s
}
@@ -289,7 +293,11 @@ func StartPods(numPods int, host string, restClient *client.Client) error {
func RunAMaster(t *testing.T) (*master.Master, *httptest.Server) {
masterConfig := NewMasterConfig()
masterConfig.EnableProfiling = true
m := master.New(masterConfig)
m, err := master.New(masterConfig)
if err != nil {
// TODO: Return error.
glog.Fatalf("error in bringing up the master: %v", err)
}
s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
m.Handler.ServeHTTP(w, req)