Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions configuration/template/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,20 @@ func MakeUtilFuncMap(varStack map[string]string) map[string]interface{} {
out = string(bytes)
return
},
"Sort": func(in interface{}) (out interface{}) {
switch inSlice := in.(type) {
case []interface{}:
stringSlice := make([]string, len(inSlice))
for idx, item := range inSlice {
stringSlice[idx] = fmt.Sprintf("%v", item)
}
slices.Sort(stringSlice)
out = stringSlice
default:
out = in
}
return
},
}
jsonMap["Deserialize"] = jsonMap["Unmarshal"]
jsonMap["Serialize"] = jsonMap["Marshal"]
Expand Down
3 changes: 3 additions & 0 deletions core/integration/odc/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"encoding/json"
"fmt"
"net/url"
"slices"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -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)))
Expand Down Expand Up @@ -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).
Expand Down