From a1a28ef8e8e0f95b62689e058cf8c2f2dc44e2a5 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Tue, 3 Apr 2018 14:00:43 -0700 Subject: [PATCH] ExternalIP to node --- apis/management.cattle.io/v3/schema/schema.go | 7 ++++--- mapper/node_address.go | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 156751cf..7b75ccf1 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -103,9 +103,10 @@ func nativeNodeTypes(schemas *types.Schemas) *types.Schemas { schema.CodeName = "InternalNodeStatus" schema.CodeNamePlural = "InternalNodeStatuses" }, struct { - IPAddress string - Hostname string - Info NodeInfo + IPAddress string + ExternalIPAddress string `json:"externalIpAddress,omitempty"` + Hostname string + Info NodeInfo }{}) } diff --git a/mapper/node_address.go b/mapper/node_address.go index 2cf19f1e..81f92102 100644 --- a/mapper/node_address.go +++ b/mapper/node_address.go @@ -15,6 +15,8 @@ func (n NodeAddressMapper) FromInternal(data map[string]interface{}) { a := address["address"] if t == "InternalIP" { data["ipAddress"] = a + } else if t == "ExternalIP" { + data["externalIpAddress"] = a } else if t == "Hostname" { data["hostname"] = a }