From c9abab982d97973ca750482584a63d356fcedb78 Mon Sep 17 00:00:00 2001 From: Joel Takvorian Date: Fri, 24 Jun 2022 16:37:18 +0200 Subject: [PATCH] Add comment Co-authored-by: Julien Pinsonneau <91894519+jpinsonneau@users.noreply.github.com> --- pkg/pipeline/transform/transform_filter.go | 1 + pkg/pipeline/transform/transform_network.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/pipeline/transform/transform_filter.go b/pkg/pipeline/transform/transform_filter.go index 3cae2a7f1..bd2783177 100644 --- a/pkg/pipeline/transform/transform_filter.go +++ b/pkg/pipeline/transform/transform_filter.go @@ -32,6 +32,7 @@ func (f *Filter) Transform(input []config.GenericMap) []config.GenericMap { log.Debugf("f = %v", f) output := make([]config.GenericMap, 0) for _, entry := range input { + // copy input entry before transform to avoid alteration on parallel stages outputEntry := entry.Copy() addToOutput := true for _, rule := range f.Rules { diff --git a/pkg/pipeline/transform/transform_network.go b/pkg/pipeline/transform/transform_network.go index 2bb45723f..68bcac3d7 100644 --- a/pkg/pipeline/transform/transform_network.go +++ b/pkg/pipeline/transform/transform_network.go @@ -49,6 +49,7 @@ func (n *Network) Transform(input []config.GenericMap) []config.GenericMap { } func (n *Network) TransformEntry(inputEntry config.GenericMap) config.GenericMap { + // copy input entry before transform to avoid alteration on parallel stages outputEntry := inputEntry.Copy() for _, rule := range n.Rules {