From e267a7064ed12aa6b1863422ac0c48898d43ec73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Thu, 10 Jan 2019 17:54:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8DPortStart=E4=B8=BA-1=E6=97=B6?= =?UTF-8?q?=E6=9C=AA=E6=AD=A3=E7=A1=AE=E8=AE=BE=E7=BD=AEPortRange=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/util/aliyun/securitygroup.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/aliyun/securitygroup.go b/pkg/util/aliyun/securitygroup.go index d49def0ec0..d584f5d602 100644 --- a/pkg/util/aliyun/securitygroup.go +++ b/pkg/util/aliyun/securitygroup.go @@ -248,7 +248,7 @@ func (self *SRegion) modifySecurityGroupRule(secGrpId string, rule *secrules.Sec protocol = "all" } params["IpProtocol"] = protocol - if rule.PortStart == 0 && rule.PortEnd == 0 { + if rule.PortStart < 1 && rule.PortEnd < 1 { if protocol == "udp" || protocol == "tcp" { params["PortRange"] = "1/65535" } else { @@ -320,7 +320,7 @@ func (self *SRegion) addSecurityGroupRule(secGrpId string, rule *secrules.Securi protocol = "all" } params["IpProtocol"] = protocol - if rule.PortStart == 0 && rule.PortEnd == 0 { + if rule.PortStart < 1 && rule.PortEnd < 1 { if protocol == "udp" || protocol == "tcp" { params["PortRange"] = "1/65535" } else { @@ -363,7 +363,7 @@ func (self *SRegion) delSecurityGroupRule(secGrpId string, rule *secrules.Securi protocol = "all" } params["IpProtocol"] = protocol - if rule.PortStart == 0 && rule.PortEnd == 0 { + if rule.PortStart < 1 && rule.PortEnd < 1 { if protocol == "udp" || protocol == "tcp" { params["PortRange"] = "1/65535" } else {