Kubelet: a step towards to better encapsulation of docker functions

We want to stop leaking more docker details into kubelet, and we also want to
consolidate some of the existing docker interfaces/structs. This change creates
DockerManager as the new home of some functions in dockertools/docker.go. It
also absorbs containerRunner. In addition, GetDockerPodStatus is renamed to
GetPodStatus with the entire pod passed to it so that it is simialr to the what
is defined in the container Runtime interface.

Eventually, DockerManager should implement the container Runtime interface, and
integrate DockerCache with a flag to turn on/off caching. Code in kubelet.go
should not be using docker client directly.
This commit is contained in:
Yu-Ju Hong
2015-04-02 13:14:52 -07:00
parent cdd6d0f313
commit d01bc660b5
8 changed files with 546 additions and 524 deletions

View File

@@ -140,7 +140,7 @@ func TestRunOnce(t *testing.T) {
t: t,
}
kb.dockerPuller = &dockertools.FakeDockerPuller{}
kb.containerRunner = &dockertools.DockerContainerRunner{kb.dockerClient, kb.recorder}
kb.containerManager = dockertools.NewDockerManager(kb.dockerClient, kb.recorder)
results, err := kb.runOnce([]api.Pod{
{
ObjectMeta: api.ObjectMeta{