fix: avoid update protocol with any faild

This commit is contained in:
Qu Xuan
2021-04-01 17:35:31 +08:00
parent c34d6984d5
commit 80580fa2e4
+1 -1
View File
@@ -339,7 +339,7 @@ func (self *SSecurityGroupRule) ValidateUpdateData(ctx context.Context, userCred
if len(input.Protocol) == 0 {
input.Protocol = self.Protocol
}
if len(input.Ports) == 0 {
if len(input.Ports) == 0 && input.Protocol != string(secrules.PROTO_ANY) && input.Protocol != string(secrules.PROTO_ICMP) {
input.Ports = self.Ports
}