Merge pull request #10750 from yousong/bugfix/yousong-vpc-acl

vpcagent: ovn: fix port match condition formation
This commit is contained in:
Zexi Li
2021-04-16 10:07:01 +08:00
committed by GitHub
+5 -1
View File
@@ -121,7 +121,11 @@ func ruleToAcl(lport string, rule *agentmodels.SecurityGroupRule) (*ovn_nb.ACL,
matches = append(matches, l4proto)
if len(portMatches) > 0 {
matches = append(matches, strings.Join(portMatches, " || "))
portMatch := strings.Join(portMatches, " || ")
if len(portMatches) > 1 {
portMatch = "( " + portMatch + " )"
}
matches = append(matches, portMatch)
}
}
switch rule.Protocol {