Skip to content

Commit

Permalink
fix compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Sep 12, 2024
1 parent d9cacec commit 7f14343
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/schedule/schedulers/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,12 @@ func FindSchedulerTypeByName(name string) types.CheckerSchedulerType {
}
}
}
// This is for compatibility. Because the string of ScatterRangeScheduler is
// "scatter-range" before. If user adds a ScatterRangeScheduler(which is
// "scatter-range" yet) and then upgrades the cluster(its ScatterRangeScheduler
// is "scatter-range-scheduler"), we need these codes to keep the compatibility.
if len(typ) == 0 && strings.Contains(name, "scatter-range") {
return types.ScatterRangeScheduler

Check warning on line 180 in pkg/schedule/schedulers/scheduler.go

View check run for this annotation

Codecov / codecov/patch

pkg/schedule/schedulers/scheduler.go#L180

Added line #L180 was not covered by tests
}
return typ
}

0 comments on commit 7f14343

Please sign in to comment.