瀏覽代碼

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

Thibault "bui" Koechlin 4 年之前
父節點
當前提交
f2b30db684
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      pkg/apiserver/apic.go

+ 8 - 0
pkg/apiserver/apic.go

@@ -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()