<p>From what I understand (and experience) - kubernetes informers calls <code>updateFunc</code> each "sync" event of its cache - From what I gather it is due to <a href="https://github.com/kubernetes/client-go/blob/117d288bbeebfecd84ac5dde6a31dc16ee2ae55d/tools/cache/controller.go#L305" rel="nofollow noreferrer">this</a> annoying peace of code.</p>

<p>An example informer definition:</p>

<pre><code>informer:= NewInformer(
&amp;cache.ListWatch{
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
  return kubeClient.Batch().Jobs(api.NamespaceAll).List(options)
},
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
  return kubeClient.Batch().Jobs(api.NamespaceAll).Watch(options)
},....)

...

informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
    AddFunc: func(obj interface{}){},
    // Make this function be called *only* on update. 
    UpdateFunc: func(old, current interface{}){},
    DeleteFunc: func(current interface{}){},
})
</code></pre>

<p>But for my use case - calling <code>updateFunc</code> should really happen only when that resource is updated (e.g. I am doing some intense computation on each update or going to I/O).</p>

<p>I was wandering is there a way to call <code>updateFunc</code> only on update?</p>

Nimrodshn
<p>I found answer <a href="https://github.com/kubernetes/client-go/issues/529" rel="nofollow noreferrer">in this github issue</a>:</p>

<blockquote>
  <p>If resourceVersion differs between old and new, an actual update event was observed.</p>
</blockquote>
