cisco-open / k8s-objectmatcher

A Kubernetes object matcher library to avoid unnecessary K8s object updates
Apache License 2.0
157 stars 29 forks source link

fix(patch): use ordered keys when marshalling json #29

Closed eachirei closed 4 years ago

eachirei commented 4 years ago
Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
Related tickets fixes #24
License Apache 2.0

What's in this PR?

Change the JSON marshalling method to sort the keys.

Why?

Infinite reconcile loops caused by different annotations because of random order JSON representation.

Additional context

I tested the implementation by forking this repo and using it in my operator.

Checklist

To Do