Skip to content

Commit 612c52f

Browse files
committed
Add anyMatch for NodeAddress match
1 parent 942e3a4 commit 612c52f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

serverscom/instances.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (i *instances) NodeAddresses(ctx context.Context, nodeName types.NodeName)
2929
}
3030

3131
for _, instance := range cloudInstances {
32-
if instance.Name == string(nodeName) {
32+
if instance.Name == string(nodeName) || anyMatch(string(nodeName), instance.PrivateIPv4Address, instance.PublicIPv4Address) {
3333
return collectCloudInstanceAddresses(&instance), nil
3434
}
3535
}
@@ -44,7 +44,7 @@ func (i *instances) NodeAddresses(ctx context.Context, nodeName types.NodeName)
4444
}
4545

4646
for _, host := range hosts {
47-
if host.Title == string(nodeName) {
47+
if host.Title == string(nodeName) || anyMatch(string(nodeName), host.PrivateIPv4Address, host.PublicIPv4Address) {
4848
return collectHostAddresses(&host), nil
4949
}
5050
}

0 commit comments

Comments
 (0)