mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #2224 from swordqiu/automated-cherry-pick-of-#2222-upstream-release-2.11
Automated cherry pick of #2222: fix: when turning off non-default-domain-projects, network public scope should swtich to system scope
This commit is contained in:
@@ -34,6 +34,7 @@ import (
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
|
||||
@@ -678,7 +679,11 @@ func (manager *SNetworkManager) newFromCloudNetwork(ctx context.Context, userCre
|
||||
net.GuestGateway = extNet.GetGateway()
|
||||
net.ServerType = extNet.GetServerType()
|
||||
net.IsPublic = extNet.GetIsPublic()
|
||||
net.PublicScope = string(extNet.GetPublicScope())
|
||||
extScope := extNet.GetPublicScope()
|
||||
if extScope == rbacutils.ScopeDomain && !consts.GetNonDefaultDomainProjects() {
|
||||
extScope = rbacutils.ScopeSystem
|
||||
}
|
||||
net.PublicScope = string(extScope)
|
||||
|
||||
net.AllocTimoutSeconds = extNet.GetAllocTimeoutSeconds()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user