This commit is contained in:
mr
2026-06-02 15:57:33 +02:00
parent c1490a7746
commit 322ea38bb4
+4
View File
@@ -70,12 +70,16 @@ func (d *DynamicResource) SetAllowedInstances(request *tools.APIRequest, instanc
} }
break break
} }
if d.SortRules != nil {
sorted := make([]ResourceInstanceITF, len(d.Instances)) sorted := make([]ResourceInstanceITF, len(d.Instances))
copy(sorted, d.Instances) copy(sorted, d.Instances)
slices.SortStableFunc(sorted, func(a, b ResourceInstanceITF) int { slices.SortStableFunc(sorted, func(a, b ResourceInstanceITF) int {
d.SortRules["partnerships"] = "%v not contains 2" d.SortRules["partnerships"] = "%v not contains 2"
return d.compareByRules(a, b, d.SortRules) return d.compareByRules(a, b, d.SortRules)
}) })
d.Instances = sorted
}
d.WatchedDynamicResource = []string{} d.WatchedDynamicResource = []string{}
return d.Instances return d.Instances
} }