From 923053aa4df995791ff35469996e47b9d59d7c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Mon, 24 Aug 2026 15:05:04 +0800 Subject: [PATCH] fix(glance): avoid receive notify when glance restart (#25409) --- pkg/image/models/images.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/image/models/images.go b/pkg/image/models/images.go index 24d44631f0..26ac7955da 100644 --- a/pkg/image/models/images.go +++ b/pkg/image/models/images.go @@ -2181,12 +2181,14 @@ func (img *SImage) Pipeline(ctx context.Context, userCred mcclient.TokenCredenti if err == nil { kwargs.Set("os_type", jsonutils.NewString(osType.Value)) } - notifyclient.SystemNotifyWithCtx(ctx, notify.NotifyPriorityNormal, notifyclient.IMAGE_ACTIVED, kwargs) - notifyclient.NotifyImportantWithCtx(ctx, []string{userCred.GetUserId()}, false, notifyclient.IMAGE_ACTIVED, kwargs) - notifyclient.EventNotify(ctx, userCred, notifyclient.SEventNotifyParam{ - Obj: img, - Action: notifyclient.ActionCreate, - }) + if !skipProbe { + notifyclient.SystemNotifyWithCtx(ctx, notify.NotifyPriorityNormal, notifyclient.IMAGE_ACTIVED, kwargs) + notifyclient.NotifyImportantWithCtx(ctx, []string{userCred.GetUserId()}, false, notifyclient.IMAGE_ACTIVED, kwargs) + notifyclient.EventNotify(ctx, userCred, notifyclient.SEventNotifyParam{ + Obj: img, + Action: notifyclient.ActionCreate, + }) + } } return nil }