Skip to content

Commit

Permalink
fix panic when switching placement rules
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx authored and ti-chi-bot committed Nov 23, 2023
1 parent ef6ba85 commit d2532a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ func (c *RuleChecker) CheckWithFit(region *core.RegionInfo, fit *placement.Regio
return
}

// the placement rule is disabled
if fit == nil {
return
}

// If the fit is calculated by FitRegion, which means we get a new fit result, thus we should
// invalid the cache if it exists
c.ruleManager.InvalidCache(region.GetID())
Expand Down

0 comments on commit d2532a8

Please sign in to comment.