fix: secgroup init rule CIDR should be empty for both ipv4 and ipv6 (#20348)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2024-05-24 10:50:10 +08:00
committed by GitHub
co-authored by Qiu Jian
parent 242f275fee
commit b2b415ed49
+2 -1
View File
@@ -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)