From 2398504d08426f80cd6a47e0cf5788305fefcaed Mon Sep 17 00:00:00 2001 From: Weidong Cai Date: Tue, 16 Jun 2020 05:35:14 +0800 Subject: [PATCH] dedup in updatePodStatus (#830) Co-authored-by: Brian Goff --- node/pod.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/pod.go b/node/pod.go index b2d4177a5..be329c898 100644 --- a/node/pod.go +++ b/node/pod.go @@ -209,6 +209,9 @@ func (pc *PodController) updatePodStatus(ctx context.Context, podFromKubernetes kPod.Lock() podFromProvider := kPod.lastPodStatusReceivedFromProvider.DeepCopy() kPod.Unlock() + if cmp.Equal(podFromKubernetes.Status, podFromProvider.Status) { + return nil + } // We need to do this because the other parts of the pod can be updated elsewhere. Since we're only updating // the pod status, and we should be the sole writers of the pod status, we can blind overwrite it. Therefore // we need to copy the pod and set ResourceVersion to 0.