mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): set security group domain id (#21093)
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"yunion.io/x/pkg/util/secrules"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
billing_api "yunion.io/x/onecloud/pkg/apis/billing"
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
@@ -339,7 +340,8 @@ func (self *SGoogleRegionDriver) CreateDefaultSecurityGroup(
|
||||
newGroup.Name = fmt.Sprintf("default-auto-%d", time.Now().Unix())
|
||||
newGroup.Description = "auto generage"
|
||||
newGroup.ManagerId = vpc.ManagerId
|
||||
newGroup.DomainId = ownerId.GetDomainId()
|
||||
newGroup.DomainId = ownerId.GetProjectDomainId()
|
||||
newGroup.ProjectSrc = string(apis.OWNER_SOURCE_LOCAL)
|
||||
newGroup.GlobalvpcId = vpc.GlobalvpcId
|
||||
newGroup.ProjectId = ownerId.GetProjectId()
|
||||
err := models.SecurityGroupManager.TableSpec().Insert(ctx, newGroup)
|
||||
|
||||
@@ -3457,8 +3457,9 @@ func (self *SManagedVirtualizationRegionDriver) CreateDefaultSecurityGroup(
|
||||
newGroup.VpcId = vpc.Id
|
||||
newGroup.ManagerId = vpc.ManagerId
|
||||
newGroup.CloudregionId = vpc.CloudregionId
|
||||
newGroup.DomainId = ownerId.GetDomainId()
|
||||
newGroup.DomainId = ownerId.GetProjectDomainId()
|
||||
newGroup.ProjectId = ownerId.GetProjectId()
|
||||
newGroup.ProjectSrc = string(apis.OWNER_SOURCE_LOCAL)
|
||||
err := models.SecurityGroupManager.TableSpec().Insert(ctx, newGroup)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "insert")
|
||||
|
||||
Reference in New Issue
Block a user