mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
azure: support nics with multiple ipconfigs
This commit is contained in:
parent
2110f72e4c
commit
6357c391f9
@ -151,9 +151,12 @@ func getPrimaryIPConfig(nic network.Interface) (*network.InterfaceIPConfiguratio
|
|||||||
return &((*nic.Properties.IPConfigurations)[0]), nil
|
return &((*nic.Properties.IPConfigurations)[0]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// we're here because we either have multiple ipconfigs and can't determine the primary:
|
for _, ref := range *nic.Properties.IPConfigurations {
|
||||||
// https://github.com/Azure/azure-rest-api-specs/issues/305
|
if *ref.Properties.Primary {
|
||||||
// or somehow we had zero ipconfigs
|
return &ref, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("failed to determine the determine primary ipconfig. nicname=%q", *nic.Name)
|
return nil, fmt.Errorf("failed to determine the determine primary ipconfig. nicname=%q", *nic.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user