port setNodeMemoryPressureCondition to Setter abstraction, add test

This commit is contained in:
Michael Taufen
2018-06-25 17:08:22 -07:00
parent c33f321acd
commit f057c9a4ae
5 changed files with 214 additions and 58 deletions

View File

@@ -292,7 +292,6 @@ func newTestKubeletWithImageList(
// Relist period does not affect the tests.
kubelet.pleg = pleg.NewGenericPLEG(fakeRuntime, 100, time.Hour, nil, clock.RealClock{})
kubelet.clock = fakeClock
kubelet.setNodeStatusFuncs = kubelet.defaultNodeStatusFuncs()
nodeRef := &v1.ObjectReference{
Kind: "Node",
@@ -338,6 +337,8 @@ func newTestKubeletWithImageList(
false, /* experimentalCheckNodeCapabilitiesBeforeMount*/
false /* keepTerminatedPodVolumes */)
kubelet.setNodeStatusFuncs = kubelet.defaultNodeStatusFuncs()
// enable active deadline handler
activeDeadlineHandler, err := newActiveDeadlineHandler(kubelet.statusManager, kubelet.recorder, kubelet.clock)
require.NoError(t, err, "Can't initialize active deadline handler")