From de7ef8baaf333488445775504ef6a7cbcc004bc7 Mon Sep 17 00:00:00 2001 From: rainzm Date: Thu, 6 May 2021 16:33:52 +0800 Subject: [PATCH] fix(cloudproxy): keep the proxy endpoint project and server consistent --- pkg/cloudproxy/models/proxy_endpoints.go | 4 ++-- pkg/mcclient/models/base.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cloudproxy/models/proxy_endpoints.go b/pkg/cloudproxy/models/proxy_endpoints.go index df7204ec63..f5ee1fd68d 100644 --- a/pkg/cloudproxy/models/proxy_endpoints.go +++ b/pkg/cloudproxy/models/proxy_endpoints.go @@ -110,8 +110,8 @@ func (man *SProxyEndpointManager) PerformCreateFromServer(ctx context.Context, u IntranetIpAddr: nic.IpAddr, } proxyendpoint.Name = name - proxyendpoint.DomainId = userCred.GetProjectDomainId() - proxyendpoint.ProjectId = userCred.GetProjectId() + proxyendpoint.DomainId = serverInfo.Server.DomainId + proxyendpoint.ProjectId = serverInfo.Server.ProjectId if err := man.TableSpec().Insert(ctx, proxyendpoint); err != nil { return nil, httperrors.NewServerError("database insertion error: %v", err) } diff --git a/pkg/mcclient/models/base.go b/pkg/mcclient/models/base.go index 0af92b0fc4..d4e2d6c492 100644 --- a/pkg/mcclient/models/base.go +++ b/pkg/mcclient/models/base.go @@ -77,6 +77,7 @@ type EnabledStatusStandaloneResource struct { type VirtualResource struct { StatusStandaloneResource + DomainId string ProjectId string IsSystem bool PendingDeletedAt time.Time