Open tenstad opened 1 month ago
Would a simple https://pkg.go.dev/sort#Slice work?
sort.Slice(e.Answer, func(i, j int) bool { return e.Answer[i].String() < e.Answer[j].String() })
or after the frule.To
loop:
sort.Slice(peers, func(i, j int) bool { return peers[i].IPBlock.CIDR < peers[j].IPBlock.CIDR })
https://github.com/nais/fqdn-policy/blob/fcbf9432a7c800d5113ddde28f212be438f92177/controllers/fqdnnetworkpolicy_controller.go#L453-L475
The list should maybe be sorted, to avoid updating the resource on every reconcile?