Replace NodeLegacyHostIP with NodeInternalIP

This commit is contained in:
Manuel de Brito Fontes 2017-05-20 20:11:58 -04:00
parent 9ddf98769a
commit b1d6468d5d
3 changed files with 11 additions and 11 deletions

View file

@ -121,7 +121,7 @@ func buildSimpleClientSet() *testclient.Clientset {
Status: api_v1.NodeStatus{ Status: api_v1.NodeStatus{
Addresses: []api_v1.NodeAddress{ Addresses: []api_v1.NodeAddress{
{ {
Type: api_v1.NodeLegacyHostIP, Type: api_v1.NodeInternalIP,
Address: "10.0.0.1", Address: "10.0.0.1",
}, { }, {
Type: api_v1.NodeExternalIP, Type: api_v1.NodeExternalIP,
@ -137,7 +137,7 @@ func buildSimpleClientSet() *testclient.Clientset {
Status: api_v1.NodeStatus{ Status: api_v1.NodeStatus{
Addresses: []api_v1.NodeAddress{ Addresses: []api_v1.NodeAddress{
{ {
Type: api_v1.NodeLegacyHostIP, Type: api_v1.NodeInternalIP,
Address: "11.0.0.1", Address: "11.0.0.1",
}, },
{ {

View file

@ -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 externalIP = address.Address
} }
} }

View file

@ -191,7 +191,7 @@ func TestGetNodeIP(t *testing.T) {
Status: api.NodeStatus{ Status: api.NodeStatus{
Addresses: []api.NodeAddress{ Addresses: []api.NodeAddress{
{ {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.1", Address: "10.0.0.1",
}, },
}, },
@ -206,7 +206,7 @@ func TestGetNodeIP(t *testing.T) {
Status: api.NodeStatus{ Status: api.NodeStatus{
Addresses: []api.NodeAddress{ Addresses: []api.NodeAddress{
{ {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.1", Address: "10.0.0.1",
}, },
}, },
@ -222,7 +222,7 @@ func TestGetNodeIP(t *testing.T) {
Status: api.NodeStatus{ Status: api.NodeStatus{
Addresses: []api.NodeAddress{ Addresses: []api.NodeAddress{
{ {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.1", Address: "10.0.0.1",
}, },
}, },
@ -235,7 +235,7 @@ func TestGetNodeIP(t *testing.T) {
Status: api.NodeStatus{ Status: api.NodeStatus{
Addresses: []api.NodeAddress{ Addresses: []api.NodeAddress{
{ {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.2", Address: "10.0.0.2",
}, },
}, },
@ -251,7 +251,7 @@ func TestGetNodeIP(t *testing.T) {
Status: api.NodeStatus{ Status: api.NodeStatus{
Addresses: []api.NodeAddress{ Addresses: []api.NodeAddress{
{ {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.1", Address: "10.0.0.1",
}, { }, {
Type: api.NodeExternalIP, Type: api.NodeExternalIP,
@ -261,7 +261,7 @@ func TestGetNodeIP(t *testing.T) {
}, },
}}}), "demo", "10.0.0.2"}, }}}), "demo", "10.0.0.2"},
// get NodeLegacyHostIP // get NodeInternalIP
{testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{ {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{
ObjectMeta: meta_v1.ObjectMeta{ ObjectMeta: meta_v1.ObjectMeta{
Name: "demo", Name: "demo",
@ -272,7 +272,7 @@ func TestGetNodeIP(t *testing.T) {
Type: api.NodeExternalIP, Type: api.NodeExternalIP,
Address: "", Address: "",
}, { }, {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.2", Address: "10.0.0.2",
}, },
}, },
@ -324,7 +324,7 @@ func TestGetPodDetails(t *testing.T) {
Status: api.NodeStatus{ Status: api.NodeStatus{
Addresses: []api.NodeAddress{ Addresses: []api.NodeAddress{
{ {
Type: api.NodeLegacyHostIP, Type: api.NodeInternalIP,
Address: "10.0.0.1", Address: "10.0.0.1",
}, },
}, },