From 747f83c221a3d0c9e233f594356af1a43944936a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20Holtbr=C3=BCgge?= Date: Sun, 28 Feb 2021 14:31:17 +0100 Subject: [PATCH] fix --- source/node.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/source/node.go b/source/node.go index 859709844d..318a1a73d4 100644 --- a/source/node.go +++ b/source/node.go @@ -180,13 +180,8 @@ func (ns *nodeSource) nodeAddresses(node *v1.Node) ([]string, error) { addresses[addr.Type] = append(addresses[addr.Type], addr.Address) } - access := getAccessFromAnnotations(node.Labels) - - if access == "public" { - return addresses[v1.NodeExternalIP], nil - } - - if access == "private" { + // TODO order is reversed... + if len(addresses[v1.NodeInternalIP]) > 0 { return addresses[v1.NodeInternalIP], nil } @@ -194,10 +189,6 @@ func (ns *nodeSource) nodeAddresses(node *v1.Node) ([]string, error) { return addresses[v1.NodeExternalIP], nil } - if len(addresses[v1.NodeInternalIP]) > 0 { - return addresses[v1.NodeInternalIP], nil - } - return nil, fmt.Errorf("could not find node address for %s", node.Name) }