mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: add default security group rules and priorities to JDCloud
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package regiondrivers
|
||||
|
||||
import (
|
||||
"yunion.io/x/pkg/util/secrules"
|
||||
|
||||
api "yunion.io/x/onecloud/pkg/apis/compute"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/compute/models"
|
||||
)
|
||||
|
||||
@@ -31,3 +34,11 @@ func (self *SJDcloudRegionDriver) IsOnlySupportAllowRules() bool {
|
||||
func (self *SJDcloudRegionDriver) IsSecurityGroupBelongVpc() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (self *SJDcloudRegionDriver) GetDefaultSecurityGroupInRule() cloudprovider.SecurityRule {
|
||||
return cloudprovider.SecurityRule{SecurityRule: *secrules.MustParseSecurityRule("in:deny any")}
|
||||
}
|
||||
|
||||
func (self *SJDcloudRegionDriver) GetDefaultSecurityGroupOutRule() cloudprovider.SecurityRule {
|
||||
return cloudprovider.SecurityRule{SecurityRule: *secrules.MustParseSecurityRule("out:allow any")}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,9 @@ func (sg *SSecurityGroup) GetRules() ([]cloudprovider.SecurityRule, error) {
|
||||
rules := sg.SecurityGroupRules
|
||||
srs := make([]cloudprovider.SecurityRule, 0, len(rules))
|
||||
for i := range rules {
|
||||
rule := secrules.SecurityRule{}
|
||||
rule := secrules.SecurityRule{
|
||||
Priority: 1,
|
||||
}
|
||||
|
||||
if rules[i].Direction == 0 {
|
||||
rule.Direction = secrules.SecurityRuleIngress
|
||||
|
||||
Reference in New Issue
Block a user