Merge pull request #10574 from ioito/automated-cherry-pick-of-#10573-upstream-release-3.7

Automated cherry pick of #10573: fix: avoid update protocol with any faild
This commit is contained in:
Zexi Li
2021-04-01 20:44:45 +08:00
committed by GitHub
+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
}