Skip to content

Commit

Permalink
fix: fix slice init length
Browse files Browse the repository at this point in the history
Signed-off-by: cuishuang <imcusg@gmail.com>
  • Loading branch information
cuishuang committed Oct 4, 2024
1 parent 1dad03b commit 3bde254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/networkpolicy/store/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func NewGroupStore() storage.Interface {
return []string{}, nil
}
if g.SourceReference.Namespace != "" {
namespacedCG := make([]string, len(g.ChildGroups))
namespacedCG := make([]string, 0, len(g.ChildGroups))
for _, childGroup := range g.ChildGroups {
namespacedCG = append(namespacedCG, g.SourceReference.Namespace+"/"+childGroup)
}
Expand Down

0 comments on commit 3bde254

Please sign in to comment.