numaproj / numaplane

Control Plane for Numaproj
Apache License 2.0
12 stars 1 forks source link

fix: comparison of 2 JSON-derived maps requires ignoring keys with empty string, int, and bool values #213

Closed juliev0 closed 2 months ago

juliev0 commented 2 months ago

Modifications

In order to test whether we need to update our Pipeline or ISBService based on the Rollout spec, we need to compare it with the one we get back from Kubernetes API Get() call. After the Pipeline or ISBService is created and reconciled, this value is the one that Numaflow Controller would have written back when it did an Update() as part of adding the Finalizer. Since Numaflow Controller would Unmarshal the JSON into a Pipelinestruct and then Marshal it back into JSON to do the Update, this means that empty values can get written in.

Previously, I was only ignoring these empty values:

But I also need to ignore empty string, numeric = 0, and bool=false.

(This issue was noticed while testing)

Verification

unit test