Move image pull throttling logic to kubelet/images

This allows runtimes in different packages (dockertools, rkt, kuberuntime) to
share the same logic. Before this change, only dockertools support this
feature. Now all three packages support image pull throttling.
This commit is contained in:
Yu-Ju Hong
2016-09-21 14:26:17 -07:00
parent 313ef63993
commit ee5b6a2550
12 changed files with 111 additions and 65 deletions

View File

@@ -106,7 +106,7 @@ func TestParallelPuller(t *testing.T) {
fakeRuntime := &ctest.FakeRuntime{}
fakeRecorder := &record.FakeRecorder{}
puller := NewImageManager(fakeRecorder, fakeRuntime, backOff, false)
puller := NewImageManager(fakeRecorder, fakeRuntime, backOff, false, 0, 0)
fakeRuntime.ImageList = []Image{{ID: "present_image", Size: 1}}
fakeRuntime.Err = c.pullerErr
@@ -197,7 +197,7 @@ func TestSerializedPuller(t *testing.T) {
fakeRuntime := &ctest.FakeRuntime{}
fakeRecorder := &record.FakeRecorder{}
puller := NewImageManager(fakeRecorder, fakeRuntime, backOff, true)
puller := NewImageManager(fakeRecorder, fakeRuntime, backOff, true, 0, 0)
fakeRuntime.ImageList = []Image{{ID: "present_image"}}
fakeRuntime.Err = c.pullerErr