Fix kubelet unit test; populate NodeName

When we build a Kubelet directly we need to populate NodeName
as well as hostname, because we bypass the functions that normally
do this for us.
This commit is contained in:
Justin Santa Barbara 2015-06-18 12:22:51 -07:00
parent 97cafd20f6
commit 27b02d0913

View File

@ -93,6 +93,7 @@ func newTestKubelet(t *testing.T) *TestKubelet {
kubelet.os = kubecontainer.FakeOS{}
kubelet.hostname = testKubeletHostname
kubelet.nodeName = testKubeletHostname
kubelet.runtimeUpThreshold = maxWaitForContainerRuntime
kubelet.networkPlugin, _ = network.InitNetworkPlugin([]network.NetworkPlugin{}, "", network.NewFakeHost(nil))
if tempDir, err := ioutil.TempDir("/tmp", "kubelet_test."); err != nil {
@ -204,6 +205,7 @@ func newTestKubeletWithFakeRuntime(t *testing.T) *TestKubeletWithFakeRuntime {
kubelet.os = kubecontainer.FakeOS{}
kubelet.hostname = testKubeletHostname
kubelet.nodeName = testKubeletHostname
kubelet.runtimeUpThreshold = maxWaitForContainerRuntime
kubelet.networkPlugin, _ = network.InitNetworkPlugin([]network.NetworkPlugin{}, "", network.NewFakeHost(nil))
if tempDir, err := ioutil.TempDir("/tmp", "kubelet_test."); err != nil {