mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 07:39:22 +00:00
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:
parent
97cafd20f6
commit
27b02d0913
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user