From e2268e8ea339c011b7934e1ad28cb84026902b43 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Sun, 20 Apr 2025 18:06:35 +0800 Subject: [PATCH] fix: start sync status (#22442) Co-authored-by: Qiu Jian --- pkg/apis/const.go | 2 ++ pkg/compute/models/guest_actions.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pkg/apis/const.go b/pkg/apis/const.go index 0015ed2f6e..2aeb25745d 100644 --- a/pkg/apis/const.go +++ b/pkg/apis/const.go @@ -48,6 +48,8 @@ const ( STATUS_UPDATE_TAGS = "update_tags" STATUS_UPDATE_TAGS_FAILED = "update_tags_fail" + STATUS_START_SYNC_STATUS = "start_sync_status" + STATUS_SYNC_STATUS = "sync_status" STATUS_DELETING = "deleting" STATUS_DELETE_FAILED = "delete_failed" diff --git a/pkg/compute/models/guest_actions.go b/pkg/compute/models/guest_actions.go index 4efd5d1e67..82049f8de1 100644 --- a/pkg/compute/models/guest_actions.go +++ b/pkg/compute/models/guest_actions.go @@ -1686,6 +1686,9 @@ func (self *SGuest) fixFakeServerInfo(ctx context.Context, userCred mcclient.Tok } func (self *SGuest) StartSyncstatus(ctx context.Context, userCred mcclient.TokenCredential, parentTaskId string) error { + if len(parentTaskId) == 0 { + self.SetStatus(ctx, userCred, apis.STATUS_START_SYNC_STATUS, "") + } driver, err := self.GetDriver() if err != nil { return errors.Wrapf(err, "GetDriver")