apimachinery icon indicating copy to clipboard operation
apimachinery copied to clipboard

Different order of objects in arrays deep equal check

Open EnriqueL8 opened this issue 1 year ago • 2 comments

Hey all!

I'm comparing two stateful sets where each of them have the same env vars but in a different order. Apart from that they are exactly the same. This is causing the code to update the stateful set in the cluster when it doesn't need to.

Sample code I used https://gist.github.com/EnriqueL8/c60ebb70b5bb48130707366467109c75

I want to understand why this deep equal is not checking the contents irrespective of the order? It's an easy fix on my side to just sort the values before comparing for example but want to understand if there is a reason behind this or simply a bug.

Thanks so much!

EnriqueL8 avatar Jun 13 '23 12:06 EnriqueL8