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

@@ -447,7 +447,7 @@ func NewMainKubelet(
return nil, fmt.Errorf("unsupported container runtime %q specified", containerRuntime)
}
klet.pleg = pleg.NewGenericPLEG(klet.containerRuntime, plegChannelCapacity, plegRelistPeriod, klet.podCache)
klet.pleg = pleg.NewGenericPLEG(klet.containerRuntime, plegChannelCapacity, plegRelistPeriod, klet.podCache, util.RealClock{})
klet.runtimeState = newRuntimeState(maxWaitForContainerRuntime, configureCBR0, klet.isContainerRuntimeVersionCompatible)
klet.updatePodCIDR(podCIDR)