pleg: add an internal clock for testability

Also add tests for the health check.
This commit is contained in:
Yu-Ju Hong
2016-03-01 17:46:11 -08:00
parent 94368df91a
commit 4846c1e1b2
4 changed files with 34 additions and 7 deletions

View File

@@ -194,7 +194,7 @@ func newTestKubelet(t *testing.T) *TestKubelet {
}
kubelet.workQueue = queue.NewBasicWorkQueue()
// Relist period does not affect the tests.
kubelet.pleg = pleg.NewGenericPLEG(fakeRuntime, 100, time.Hour, nil)
kubelet.pleg = pleg.NewGenericPLEG(fakeRuntime, 100, time.Hour, nil, util.RealClock{})
kubelet.clock = fakeClock
kubelet.setNodeStatusFuncs = kubelet.defaultNodeStatusFuncs()
return &TestKubelet{kubelet, fakeRuntime, mockCadvisor, fakeKubeClient, fakeMirrorClient, fakeClock, nil}