mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: add vm integrity check notify (#16206)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
+3
@@ -11,3 +11,6 @@
|
||||
{{- if eq .resource_type "image" }}
|
||||
镜像{{ $d.name }}完整性校验失败
|
||||
{{- end -}}
|
||||
{{- if eq .resource_type "vm_integrity" }}
|
||||
主机{{ $d.name }}完整性校验失败
|
||||
{{- end -}}
|
||||
|
||||
@@ -136,6 +136,7 @@ const (
|
||||
TOPIC_RESOURCE_WORKER = "worker"
|
||||
TOPIC_RESOURCE_NET = "net"
|
||||
TOPIC_RESOURCE_SERVICE = "service"
|
||||
TOPIC_RESOURCE_VM_INTEGRITY_CHECK = "vm_integrity"
|
||||
|
||||
SUBSCRIBER_TYPE_ROLE = "role"
|
||||
SUBSCRIBER_TYPE_ROBOT = "robot"
|
||||
|
||||
@@ -433,3 +433,9 @@ func FetchNotifyAdminRecipients(ctx context.Context, region string, users []stri
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func NotifyVmIntegrity(ctx context.Context, name string) {
|
||||
data := jsonutils.NewDict()
|
||||
data.Add(jsonutils.NewString(name), "name")
|
||||
SystemExceptionNotifyWithResult(ctx, api.ActionChecksumTest, api.TOPIC_RESOURCE_DB_TABLE_RECORD, api.ResultFailed, data)
|
||||
}
|
||||
|
||||
@@ -509,6 +509,11 @@ func init() {
|
||||
"database table record",
|
||||
"数据库记录",
|
||||
},
|
||||
sI18nElme{
|
||||
api.TOPIC_RESOURCE_VM_INTEGRITY_CHECK,
|
||||
"vm server integrity check",
|
||||
"虚拟主机完整性校验",
|
||||
},
|
||||
sI18nElme{
|
||||
api.TOPIC_RESOURCE_ACTION_LOG,
|
||||
"action log",
|
||||
|
||||
@@ -332,6 +332,7 @@ func (sm *STopicManager) InitializeData() error {
|
||||
case DefaultChecksumTestFailed:
|
||||
t.addResources(
|
||||
notify.TOPIC_RESOURCE_DB_TABLE_RECORD,
|
||||
notify.TOPIC_RESOURCE_VM_INTEGRITY_CHECK,
|
||||
notify.TOPIC_RESOURCE_CLOUDPODS_COMPONENT,
|
||||
notify.TOPIC_RESOURCE_SNAPSHOT,
|
||||
notify.TOPIC_RESOURCE_IMAGE,
|
||||
@@ -682,6 +683,7 @@ func init() {
|
||||
notify.TOPIC_RESOURCE_ACCOUNT_STATUS: 38,
|
||||
notify.TOPIC_RESOURCE_NET: 39,
|
||||
notify.TOPIC_RESOURCE_SERVICE: 40,
|
||||
notify.TOPIC_RESOURCE_VM_INTEGRITY_CHECK: 41,
|
||||
},
|
||||
)
|
||||
converter.registerAction(
|
||||
|
||||
Reference in New Issue
Block a user