Add SyncPod() to DockerManager and use in Kubelet.

This allows us to abstract away the logic of syncing a pod by the
runtime. It will allow other runtimes to perform their own sync as well.
This commit is contained in:
Victor Marmol
2015-04-30 18:37:15 -07:00
parent bb8ee5b0db
commit 3b9eba2c1b
8 changed files with 173 additions and 254 deletions

View File

@@ -96,8 +96,6 @@ func TestRunHandlerExec(t *testing.T) {
handlerRunner := NewHandlerRunner(&fakeHTTP{}, &fakeCommandRunner, nil)
containerID := "abc1234"
podName := "podFoo"
podNamespace := "nsFoo"
containerName := "containerFoo"
container := api.Container{
@@ -112,8 +110,8 @@ func TestRunHandlerExec(t *testing.T) {
}
pod := api.Pod{}
pod.ObjectMeta.Name = podName
pod.ObjectMeta.Namespace = podNamespace
pod.ObjectMeta.Name = "podFoo"
pod.ObjectMeta.Namespace = "nsFoo"
pod.Spec.Containers = []api.Container{container}
err := handlerRunner.Run(containerID, &pod, &container, container.Lifecycle.PostStart)
if err != nil {
@@ -140,8 +138,6 @@ func TestRunHandlerHttp(t *testing.T) {
handlerRunner := NewHandlerRunner(&fakeHttp, &fakeContainerCommandRunner{}, nil)
containerID := "abc1234"
podName := "podFoo"
podNamespace := "nsFoo"
containerName := "containerFoo"
container := api.Container{
@@ -157,8 +153,8 @@ func TestRunHandlerHttp(t *testing.T) {
},
}
pod := api.Pod{}
pod.ObjectMeta.Name = podName
pod.ObjectMeta.Namespace = podNamespace
pod.ObjectMeta.Name = "podFoo"
pod.ObjectMeta.Namespace = "nsFoo"
pod.Spec.Containers = []api.Container{container}
err := handlerRunner.Run(containerID, &pod, &container, container.Lifecycle.PostStart)