fix: monitor commonalert not detach alert resource

This commit is contained in:
Zexi Li
2020-10-20 13:19:49 +08:00
parent 2bc39203ea
commit 06a30edcf8
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -40,6 +40,10 @@ func (drvF *nodeDriverF) IsEvalMatched(input monitor.EvalMatch) bool {
if !hasResType {
return false
}
_, hasHostType := tags[hostconsts.TELEGRAF_TAG_KEY_HOST_TYPE]
if !hasHostType {
return false
}
_, hasHost := tags[NODE_TAG_HOST_KEY]
if !hasHost {
return false
+2 -2
View File
@@ -782,9 +782,9 @@ func (alert *SCommonAlert) CustomizeDelete(
err := alert.customizeDeleteNotis(ctx, userCred, query, data)
if err != nil {
alert.SetStatus(userCred, monitor.ALERT_STATUS_DELETE_FAIL, "")
return errors.Wrap(err, "customizeDeleteNotis")
}
return err
return alert.SAlert.CustomizeDelete(ctx, userCred, query, data)
}
func (alert *SCommonAlert) customizeDeleteNotis(