Skip to content

Commit

Permalink
Fix var copy
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Emmanuel Jacquier <[email protected]>
  • Loading branch information
pierre-emmanuelJ committed Nov 14, 2024
1 parent 48a1f4a commit cf1bcfe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions exoscale/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,13 @@ func (i *instances) NodeAddressesByProviderID(ctx context.Context, providerID st
return nil, err
}

instanceName := instance.Name
addresses := []v1.NodeAddress{
{Type: v1.NodeHostName, Address: instanceName},
{Type: v1.NodeHostName, Address: instance.Name},
}

foundInternalIP := false
if i.p.client != nil && instance.PrivateNetworks != nil && len(instance.PrivateNetworks) > 0 {
if node, _ := i.p.kclient.CoreV1().Nodes().Get(ctx, instanceName, metav1.GetOptions{}); node != nil {
if node, _ := i.p.kclient.CoreV1().Nodes().Get(ctx, instance.Name, metav1.GetOptions{}); node != nil {
if providedIP, ok := node.ObjectMeta.Annotations[cloudproviderapi.AnnotationAlphaProvidedIPAddr]; ok {
addresses = append(
addresses,
Expand Down

0 comments on commit cf1bcfe

Please sign in to comment.