ensure decisions from local or tainted scenarios aren't push, neither are manual decisions (#536)

This commit is contained in:
Thibault "bui" Koechlin 2020-12-14 12:46:07 +01:00 committed by GitHub
parent bb679310c7
commit f2b30db684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,6 +165,14 @@ func (a *apic) Push() error {
case alerts := <-a.alertToPush:
var signals []*models.AddSignalsRequestItem
for _, alert := range alerts {
/*we're only interested into decisions coming from scenarios of the hub*/
if alert.ScenarioHash == nil || *alert.ScenarioHash == "" {
continue
}
/*and we're not interested into tainted scenarios neither*/
if alert.ScenarioVersion == nil || *alert.ScenarioVersion == "" || *alert.ScenarioVersion == "?" {
continue
}
signals = append(signals, AlertToSignal(alert))
}
a.mu.Lock()