mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
Merge pull request #7786 from rainzm/scheduler/igselect
fix(scheduler): fix array out of bounds when sorting hosts
This commit is contained in:
@@ -98,7 +98,7 @@ func buildHosts(result *core.SchedResultItemList, groups map[string]*models.SGro
|
||||
// sortHost sorts the host for guest that is the backup one of the high-availability guest
|
||||
// if isBackup is true and the master one if isBackup is false.
|
||||
func sortHosts(hosts []*sSchedResultItem, guestInfo *sGuestInfo, isBackup *bool) {
|
||||
sortIndexi, sortIndexj := make([]int64, 4), make([]int64, 4)
|
||||
sortIndexi, sortIndexj := make([]int64, 5), make([]int64, 5)
|
||||
sort.Slice(hosts, func(i, j int) bool {
|
||||
switch {
|
||||
case isBackup == nil:
|
||||
|
||||
Reference in New Issue
Block a user