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

@@ -131,12 +131,15 @@ type thirdPartyEntry struct {
// Certain config fields will be set to a default value if unset.
// Certain config fields must be specified, including:
// KubeletClient
func New(c *Config) *Master {
func New(c *Config) (*Master, error) {
if c.KubeletClient == nil {
glog.Fatalf("Master.New() called with config.KubeletClient == nil")
return nil, fmt.Errorf("Master.New() called with config.KubeletClient == nil")
}
s := genericapiserver.New(c.Config)
s, err := genericapiserver.New(c.Config)
if err != nil {
return nil, err
}
m := &Master{
GenericAPIServer: s,
@@ -155,7 +158,7 @@ func New(c *Config) *Master {
m.NewBootstrapController().Start()
}
return m
return m, nil
}
func (m *Master) InstallAPIs(c *Config) {