Kublet watches Pods.

Added a kubelet config source for watching pods on apiserver.
The pods are converted to boundpods for merging with other
config sources.

The preferred way to create a kubelet is now to pass an apiserver
client but not an etcd client.  Changed cmd/integration to use
apiserver to talk to kubelets.  And cmd/kubernetes.

Unit, integration, and e2e tests pass, except for a failure of the pd
e2e test which was unrelated.
This commit is contained in:
Eric Tune
2014-11-21 13:14:30 -08:00
parent c13ae34b02
commit b759f67ee3
6 changed files with 30 additions and 7 deletions

View File

@@ -46,6 +46,7 @@ func init() {
}
func newTestKubelet(t *testing.T) (*Kubelet, *tools.FakeEtcdClient, *dockertools.FakeDockerClient) {
// TODO: get rid of fakeEtcdClient and return value.
fakeEtcdClient := tools.NewFakeEtcdClient(t)
fakeDocker := &dockertools.FakeDockerClient{
RemovedImages: util.StringSet{},
@@ -54,10 +55,11 @@ func newTestKubelet(t *testing.T) (*Kubelet, *tools.FakeEtcdClient, *dockertools
kubelet := &Kubelet{}
kubelet.dockerClient = fakeDocker
kubelet.dockerPuller = &dockertools.FakeDockerPuller{}
kubelet.etcdClient = fakeEtcdClient
kubelet.rootDirectory = "/tmp/kubelet"
kubelet.podWorkers = newPodWorkers()
kubelet.sourceReady = func(source string) bool { return true }
kubelet.masterServiceNamespace = api.NamespaceDefault
kubelet.serviceLister = testServiceLister{}
return kubelet, fakeEtcdClient, fakeDocker
}