Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Holtbrügge committed Feb 28, 2021
1 parent 95f1467 commit 747f83c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions source/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,15 @@ 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
}

if len(addresses[v1.NodeExternalIP]) > 0 {
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)
}

Expand Down

0 comments on commit 747f83c

Please sign in to comment.