From fb39f7c3a14e34f54cabff122c4cc001e2176ea6 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Fri, 24 May 2024 10:47:32 +0800 Subject: [PATCH] fix: secgroup init rule CIDR should be empty for both ipv4 and ipv6 (#20346) Co-authored-by: Qiu Jian --- pkg/compute/models/secgroups.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/compute/models/secgroups.go b/pkg/compute/models/secgroups.go index 158b0be01d..2165b76635 100644 --- a/pkg/compute/models/secgroups.go +++ b/pkg/compute/models/secgroups.go @@ -829,7 +829,8 @@ func (manager *SSecurityGroupManager) InitializeData() error { defRule.Direction = secrules.DIR_IN defRule.Protocol = secrules.PROTO_ANY defRule.Priority = 1 - defRule.CIDR = "0.0.0.0/0" + // empty CIDR means ::/0 or 0.0.0.0/0 + defRule.CIDR = "" // "0.0.0.0/0" defRule.Action = string(secrules.SecurityRuleAllow) defRule.SecgroupId = api.SECGROUP_DEFAULT_ID err = SecurityGroupRuleManager.TableSpec().Insert(context.TODO(), &defRule)