mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +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
|
||||
}
|
||||
|
||||
// we're here because we either have multiple ipconfigs and can't determine the primary:
|
||||
// https://github.com/Azure/azure-rest-api-specs/issues/305
|
||||
// or somehow we had zero ipconfigs
|
||||
for _, ref := range *nic.Properties.IPConfigurations {
|
||||
if *ref.Properties.Primary {
|
||||
return &ref, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("failed to determine the determine primary ipconfig. nicname=%q", *nic.Name)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user