From 882c5ddc860f5fdca409937ea94ffa3fc3685672 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Tue, 21 Apr 2020 21:12:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=85=E5=BD=93=E5=8F=98=E6=9B=B4doma?= =?UTF-8?q?inId=E6=97=B6=E6=89=8D=E9=9C=80=E8=A6=81=E6=9B=B4=E6=96=B0proje?= =?UTF-8?q?ctId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/external_projects.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/compute/models/external_projects.go b/pkg/compute/models/external_projects.go index ca6a0b4fdc..e9ddeaf3ce 100644 --- a/pkg/compute/models/external_projects.go +++ b/pkg/compute/models/external_projects.go @@ -182,8 +182,10 @@ func (self *SExternalProject) SyncWithCloudProject(ctx context.Context, userCred diff, err := db.UpdateWithLock(ctx, self, func() error { self.Name = ext.GetName() self.IsEmulated = ext.IsEmulated() - self.ProjectId = provider.ProjectId - self.DomainId = provider.DomainId + if self.DomainId != provider.DomainId { + self.ProjectId = provider.ProjectId + self.DomainId = provider.DomainId + } return nil }) if err != nil {