mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: add priority for openstack secgroup rule priority
This commit is contained in:
@@ -186,9 +186,16 @@ func (secgrouprule *SSecurityGroupRule) toRules() []secrules.SecurityRule {
|
||||
|
||||
func (secgroup *SSecurityGroup) GetRules() ([]secrules.SecurityRule, error) {
|
||||
rules := []secrules.SecurityRule{}
|
||||
priority := 100
|
||||
for _, rule := range secgroup.SecurityGroupRules {
|
||||
if priority < 2 {
|
||||
priority = 2
|
||||
}
|
||||
subRules := rule.toRules()
|
||||
rules = append(rules, subRules...)
|
||||
for _, subRule := range subRules {
|
||||
subRule.Priority = priority
|
||||
rules = append(rules, subRule)
|
||||
}
|
||||
}
|
||||
defaultDenyRule := secrules.MustParseSecurityRule("out:deny any")
|
||||
defaultDenyRule.Priority = 1
|
||||
|
||||
Reference in New Issue
Block a user