From caa0979a9466902936d955dec60ff6f53bdd0928 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 11 Dec 2024 14:45:13 +0100 Subject: [PATCH] [core] Sort detector list before including in ODC payload --- core/integration/odc/plugin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/integration/odc/plugin.go b/core/integration/odc/plugin.go index a881f4b3..ea3a7a28 100644 --- a/core/integration/odc/plugin.go +++ b/core/integration/odc/plugin.go @@ -33,6 +33,7 @@ import ( "encoding/json" "fmt" "net/url" + "slices" "strconv" "strings" "sync" @@ -715,6 +716,7 @@ func (p *Plugin) ObjectStack(varStack map[string]string, baseConfigStack map[str if ok && strings.ToLower(strings.TrimSpace(ctpReadoutEnabled)) == "true" { detectorsSlice = append(detectorsSlice, "TRG") } + slices.Sort(detectorsSlice) pdpDetectorList = strings.Join(detectorsSlice, ",") } accumulator = append(accumulator, fmt.Sprintf("WORKFLOW_DETECTORS='%s'", strings.TrimSpace(pdpDetectorList))) @@ -1231,6 +1233,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) { if ok { detectorsSlice, err := p.parseDetectors(detectorListS) if err == nil { + slices.Sort(detectorsSlice) arguments["detectors"] = strings.Join(detectorsSlice, ",") } else { log.WithField("partition", envId).