Don't run OOM watcher is cAdvisor is not available.

Fixes #8424.
This commit is contained in:
Victor Marmol
2015-05-18 12:18:12 -07:00
parent a7341cfb77
commit 4a1100bb66
3 changed files with 24 additions and 21 deletions

View File

@@ -54,9 +54,11 @@ func TestBasic(t *testing.T) {
mockCadvisor := &cadvisor.Fake{}
node := &api.ObjectReference{}
oomWatcher := NewOOMWatcher(mockCadvisor, fakeRecorder)
go func() {
oomWatcher.RecordSysOOMs(node)
}()
err := oomWatcher.Start(node)
if err != nil {
t.Errorf("Should not have failed: %v", err)
}
// TODO: Improve this test once cadvisor exports events.EventChannel as an interface
// and thereby allow using a mock version of cadvisor.
}