From 20dee871cb4859ff7bfc9c2108c6511ba3ee0dbe Mon Sep 17 00:00:00 2001 From: Ashley Dumaine Date: Tue, 1 Oct 2024 16:44:14 -0400 Subject: [PATCH] handle cases where the internal-ip is already set (e.g. kubelet) --- cloud/linode/instances.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cloud/linode/instances.go b/cloud/linode/instances.go index 0a78e5d6..d232490d 100644 --- a/cloud/linode/instances.go +++ b/cloud/linode/instances.go @@ -279,6 +279,14 @@ func (i *instances) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloud return nil, err } + for _, addr := range node.Status.Addresses { + if addr.Type == v1.NodeInternalIP { + ips = append(ips, nodeIP{ + ip: addr.String(), + ipType: addr.Type, + }) + } + } addresses := []v1.NodeAddress{{Type: v1.NodeHostName, Address: linode.Label}} for _, ip := range ips {