mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Automatic merge from release/2.4.0 -> release/2.5.0
* commit '8e1fe97fb1f6253b880af023a9a5653dc4842efc': 修复: 裸金属服务器分配IP选择错误的网卡
This commit is contained in:
@@ -117,7 +117,7 @@ func (self *SBaremetalGuestDriver) Attach2RandomNetwork(guest *models.SGuest, ct
|
||||
if len(netConfig.Wire) > 0 {
|
||||
wirePattern = regexp.MustCompile(netConfig.Wire)
|
||||
}
|
||||
for _, netif := range netifs {
|
||||
for idx, netif := range netifs {
|
||||
if !netif.IsUsableServernic() {
|
||||
continue
|
||||
}
|
||||
@@ -136,7 +136,7 @@ func (self *SBaremetalGuestDriver) Attach2RandomNetwork(guest *models.SGuest, ct
|
||||
}
|
||||
if net != nil {
|
||||
netsAvaiable = append(netsAvaiable, *net)
|
||||
netifIndexs[net.Id] = &netif
|
||||
netifIndexs[net.Id] = &netifs[idx]
|
||||
}
|
||||
}
|
||||
if len(netsAvaiable) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user