diff --git a/pkg/controller/networkpolicy/store/group.go b/pkg/controller/networkpolicy/store/group.go index a7fac1e5447..d44c0efb44c 100644 --- a/pkg/controller/networkpolicy/store/group.go +++ b/pkg/controller/networkpolicy/store/group.go @@ -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) }