ensure machineID is included early enough into the alert (#1004)
This commit is contained in:
parent
203be9bfbf
commit
2961a0ed02
|
@ -127,6 +127,7 @@ func (c *Controller) CreateAlert(gctx *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, alert := range input {
|
for _, alert := range input {
|
||||||
|
alert.MachineID = machineID
|
||||||
if len(alert.Decisions) != 0 {
|
if len(alert.Decisions) != 0 {
|
||||||
for pIdx, profile := range c.Profiles {
|
for pIdx, profile := range c.Profiles {
|
||||||
_, matched, err := csprofiles.EvaluateProfile(profile, alert)
|
_, matched, err := csprofiles.EvaluateProfile(profile, alert)
|
||||||
|
@ -168,9 +169,6 @@ func (c *Controller) CreateAlert(gctx *gin.Context) {
|
||||||
c.HandleDBErrors(gctx, err)
|
c.HandleDBErrors(gctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, alert := range input {
|
|
||||||
alert.MachineID = machineID
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.CAPIChan != nil {
|
if c.CAPIChan != nil {
|
||||||
select {
|
select {
|
||||||
|
|
Loading…
Reference in a new issue