diff --git a/core/pkg/ingress/status/status_test.go b/core/pkg/ingress/status/status_test.go index e5b3f26f6..4b97c46a9 100644 --- a/core/pkg/ingress/status/status_test.go +++ b/core/pkg/ingress/status/status_test.go @@ -121,7 +121,7 @@ func buildSimpleClientSet() *testclient.Clientset { Status: api_v1.NodeStatus{ Addresses: []api_v1.NodeAddress{ { - Type: api_v1.NodeLegacyHostIP, + Type: api_v1.NodeInternalIP, Address: "10.0.0.1", }, { Type: api_v1.NodeExternalIP, @@ -137,7 +137,7 @@ func buildSimpleClientSet() *testclient.Clientset { Status: api_v1.NodeStatus{ Addresses: []api_v1.NodeAddress{ { - Type: api_v1.NodeLegacyHostIP, + Type: api_v1.NodeInternalIP, Address: "11.0.0.1", }, { diff --git a/core/pkg/k8s/main.go b/core/pkg/k8s/main.go index 7f8436186..44d0fb539 100644 --- a/core/pkg/k8s/main.go +++ b/core/pkg/k8s/main.go @@ -94,7 +94,7 @@ func GetNodeIP(kubeClient clientset.Interface, name string) string { } } - if externalIP == "" && address.Type == api.NodeLegacyHostIP { + if externalIP == "" && address.Type == api.NodeInternalIP { externalIP = address.Address } } diff --git a/core/pkg/k8s/main_test.go b/core/pkg/k8s/main_test.go index 962db0759..af6468dc7 100644 --- a/core/pkg/k8s/main_test.go +++ b/core/pkg/k8s/main_test.go @@ -191,7 +191,7 @@ func TestGetNodeIP(t *testing.T) { Status: api.NodeStatus{ Addresses: []api.NodeAddress{ { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.1", }, }, @@ -206,7 +206,7 @@ func TestGetNodeIP(t *testing.T) { Status: api.NodeStatus{ Addresses: []api.NodeAddress{ { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.1", }, }, @@ -222,7 +222,7 @@ func TestGetNodeIP(t *testing.T) { Status: api.NodeStatus{ Addresses: []api.NodeAddress{ { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.1", }, }, @@ -235,7 +235,7 @@ func TestGetNodeIP(t *testing.T) { Status: api.NodeStatus{ Addresses: []api.NodeAddress{ { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.2", }, }, @@ -251,7 +251,7 @@ func TestGetNodeIP(t *testing.T) { Status: api.NodeStatus{ Addresses: []api.NodeAddress{ { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.1", }, { Type: api.NodeExternalIP, @@ -261,7 +261,7 @@ func TestGetNodeIP(t *testing.T) { }, }}}), "demo", "10.0.0.2"}, - // get NodeLegacyHostIP + // get NodeInternalIP {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{ ObjectMeta: meta_v1.ObjectMeta{ Name: "demo", @@ -272,7 +272,7 @@ func TestGetNodeIP(t *testing.T) { Type: api.NodeExternalIP, Address: "", }, { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.2", }, }, @@ -324,7 +324,7 @@ func TestGetPodDetails(t *testing.T) { Status: api.NodeStatus{ Addresses: []api.NodeAddress{ { - Type: api.NodeLegacyHostIP, + Type: api.NodeInternalIP, Address: "10.0.0.1", }, },