Require a KubeletClient in master.New().

Without this, tests which create a master
will panic with a nil pointer when the periodic
podCache update runs.

Deleted unused FakePodInfoGetter.
Added FakeKubeletClient.
Passed to master.New.
Required a KubeletClient in master.New.
This commit is contained in:
Eric Tune
2014-11-03 14:50:41 -08:00
parent 2446347b07
commit 795bc7f976
4 changed files with 18 additions and 7 deletions

View File

@@ -206,6 +206,9 @@ func New(c *Config) *Master {
boundPodFactory := &pod.BasicBoundPodFactory{
ServiceRegistry: serviceRegistry,
}
if c.KubeletClient == nil {
glog.Fatalf("master.New() called with config.KubeletClient == nil")
}
m := &Master{
podRegistry: etcd.NewRegistry(c.EtcdHelper, boundPodFactory),
controllerRegistry: etcd.NewRegistry(c.EtcdHelper, nil),