Kubelet: replace DockerManager with the Runtime interface

This change instructs kubelet to switch to using the Runtime interface. In order
to do it, the change moves the Prober instantiation to DockerManager.

Note that most of the tests in kubelet_test.go needs to be migrated to
dockertools. For now, we use type assertion to convert the Runtime interface to
DockerManager in most tests.
This commit is contained in:
Yu-Ju Hong
2015-05-01 15:25:11 -07:00
parent e87d735304
commit 1ad4dd7803
9 changed files with 404 additions and 366 deletions

View File

@@ -88,7 +88,7 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {
delay := retryDelay
retry := 0
for {
pods, err := kl.containerManager.GetPods(false)
pods, err := kl.containerRuntime.GetPods(false)
if err != nil {
return fmt.Errorf("failed to get kubelet pods: %v", err)
}
@@ -120,7 +120,7 @@ func (kl *Kubelet) runPod(pod *api.Pod, retryDelay time.Duration) error {
// isPodRunning returns true if all containers of a manifest are running.
func (kl *Kubelet) isPodRunning(pod *api.Pod, runningPod container.Pod) (bool, error) {
status, err := kl.containerManager.GetPodStatus(pod)
status, err := kl.containerRuntime.GetPodStatus(pod)
if err != nil {
glog.Infof("Failed to get the status of pod %q: %v", kubecontainer.GetPodFullName(pod), err)
return false, err