diff --git a/pkg/schedule/schedulers/scheduler.go b/pkg/schedule/schedulers/scheduler.go index 27be70680af..32c8f3ddaed 100644 --- a/pkg/schedule/schedulers/scheduler.go +++ b/pkg/schedule/schedulers/scheduler.go @@ -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 + } return typ }