Alerting: Avoid panic by not loading instances without a rule (#33597)

This commit is contained in:
Kyle Brandt 2021-05-01 13:01:28 -04:00 committed by GitHub
parent 528edcaec6
commit c2a5da79e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,6 +373,7 @@ func (sch *schedule) WarmStateCache(st *state.Manager) {
ruleForEntry, ok := ruleByUID[entry.RuleDefinitionUID]
if !ok {
sch.log.Error("rule not found for instance, ignoring", "rule", entry.RuleDefinitionUID)
continue
}
lbs := map[string]string(entry.Labels)