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

Remove null fields from current object #15

Closed pepov closed 5 years ago

pepov commented 5 years ago
Q A
Bug fix? yes
New feature? no
API breaks? no
Deprecations? no
License Apache 2.0

What's in this PR?

Removes null fields from current object before matching because there are cases where it's necessary.

Why?

Persistentvolumeclaimtemplates in StatefulSets are root objects and for example the CreationTimestamp field will not be set in it, but left empty, which will be null. This will result in an unnecessary diff, that we want to avoid, thus removing null fields from current.

Additional context

The issue came up in the bank-vaults project.