Open modax opened 8 years ago
@modax,
I see at least one instance where array order is important: container command arguments. But we can possibly live with this drawback.
But, more important, your version seems incorrect to me.
In our tests, it seems it always compares all elements of is
to only the first element of should
, leaving out the other elements of should
.
Actually this is a rewrite of fuzzy_compare which primarily make it work with arrays.
Current implementation was not correct with more than one element in the array. What is more, I believe that when comparing kubernetes descriptors we should compare arrays by their content ignoring element order. That's because kubernetes will reorder elements in arrays (I can't think of a case where element order is significant) after initial descriptor upload.
This is 1:1 based on commit you already cherry-picked in gareth-kubernetes from my fork: https://github.com/garethr/garethr-kubernetes/commit/accf0b5b279d88fd0edd91ac0a70984894fe5ffc