mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #11430 from zexi/fix/host-sched-cache
fix(region): clean schedule cache when host add or delete netif
This commit is contained in:
@@ -2369,8 +2369,9 @@ func (s *SBaremetalServer) GetDiskConfig() ([]*api.BaremetalDiskConfig, error) {
|
||||
|
||||
if len(layouts) != 0 {
|
||||
firstDisk := layouts[0]
|
||||
// convert to normal order if first disk is PCIE driver
|
||||
if firstDisk.Conf.Driver == baremetal.DISK_DRIVER_PCIE {
|
||||
// convert to normal order if first disk is Linux or PCIE driver
|
||||
driver := firstDisk.Conf.Driver
|
||||
if utils.IsInStringArray(driver, []string{baremetal.DISK_DRIVER_LINUX, baremetal.DISK_DRIVER_PCIE}) {
|
||||
return baremetal.GetLayoutDiskConfig(layouts), nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4307,6 +4307,7 @@ func (self *SHost) addNetif(ctx context.Context, userCred mcclient.TokenCredenti
|
||||
return httperrors.NewBadRequestError("%v", err)
|
||||
}
|
||||
}
|
||||
self.ClearSchedDescCache()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4619,6 +4620,7 @@ func (self *SHost) RemoveNetif(ctx context.Context, userCred mcclient.TokenCrede
|
||||
}
|
||||
}
|
||||
}
|
||||
self.ClearSchedDescCache()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user