dedup in updatePodStatus (#830)
Co-authored-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
@@ -209,6 +209,9 @@ func (pc *PodController) updatePodStatus(ctx context.Context, podFromKubernetes
|
|||||||
kPod.Lock()
|
kPod.Lock()
|
||||||
podFromProvider := kPod.lastPodStatusReceivedFromProvider.DeepCopy()
|
podFromProvider := kPod.lastPodStatusReceivedFromProvider.DeepCopy()
|
||||||
kPod.Unlock()
|
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
|
// 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
|
// 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.
|
// we need to copy the pod and set ResourceVersion to 0.
|
||||||
|
|||||||
Reference in New Issue
Block a user