diff --git a/pkg/compute/models/secgrouprules.go b/pkg/compute/models/secgrouprules.go index 46b032e195..24d83c9ba8 100644 --- a/pkg/compute/models/secgrouprules.go +++ b/pkg/compute/models/secgrouprules.go @@ -374,8 +374,8 @@ func (manager *SSecurityGroupRuleManager) SyncRules(ctx context.Context, userCre func (manager *SSecurityGroupRuleManager) newFromCloudSecurityGroup(rule secrules.SecurityRule, secgroup *SSecurityGroup) (*SSecurityGroupRule, error) { protocol := rule.Protocol - if rule.Protocol == "any" { - protocol = "" + if len(protocol) == 0 { + protocol = secrules.PROTO_ANY } ports, _ports := "", make([]string, len(rule.Ports)) if len(rule.Ports) > 0 {