From 28a66e183d4e758e165ac84deb2cc86a5282fb54 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Fri, 7 Oct 2022 13:15:33 +0200 Subject: [PATCH] Update relabel.Process comment Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- model/relabel/relabel.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/model/relabel/relabel.go b/model/relabel/relabel.go index e0d7f6ddf5..b4bb999f75 100644 --- a/model/relabel/relabel.go +++ b/model/relabel/relabel.go @@ -188,10 +188,12 @@ func (re Regexp) String() string { return str[4 : len(str)-2] } -// Process returns a relabeled copy of the given label set. The relabel configurations +// Process returns a relabeled version of the given label set. The relabel configurations // are applied in order of input. +// There are circumstances where Process will modify the input label. +// If you want to avoid issues with the input label set being modified, at the cost of +// higher memory usage, you can use lbls.Copy(). // If a label set is dropped, nil is returned. -// May return the input labelSet modified. func Process(lbls labels.Labels, cfgs ...*Config) labels.Labels { lb := labels.NewBuilder(nil) for _, cfg := range cfgs {