mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
sync security group bugfix
This commit is contained in:
@@ -226,7 +226,8 @@ func yunionPortRangeToAws(r secrules.SecurityRule) []portRange {
|
||||
portranges = append(portranges, portRange{int64(start), int64(end)})
|
||||
}
|
||||
|
||||
for _, port := range r.Ports {
|
||||
for i, _ := range r.Ports {
|
||||
port := r.Ports[i]
|
||||
if port <= 0 && (r.Protocol == "tcp" || r.Protocol == "udp") {
|
||||
portranges = append(portranges, portRange{0, 65535})
|
||||
} else if port <= 0 {
|
||||
@@ -322,7 +323,8 @@ func YunionSecRuleToAws(rule secrules.SecurityRule) ([]*ec2.IpPermission, error)
|
||||
portranges := yunionPortRangeToAws(rule)
|
||||
protocol := yunionProtocolToAws(rule)
|
||||
permissions := []*ec2.IpPermission{}
|
||||
for _, port := range portranges {
|
||||
for i, _ := range portranges {
|
||||
port := portranges[i]
|
||||
permission := ec2.IpPermission{
|
||||
FromPort: &port.Start,
|
||||
IpProtocol: &protocol,
|
||||
|
||||
Reference in New Issue
Block a user