mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-08-08 23:37:11 +00:00
Fix potential race in PodStatusPatchCall implementation
This commit is contained in:
@@ -127,11 +127,12 @@ func (psuc *PodStatusPatchCall) Sync(obj metav1.Object) (metav1.Object, error) {
|
||||
// because otherwise it's irrelevant and might race.
|
||||
psuc.podStatus = pod.Status.DeepCopy()
|
||||
}
|
||||
newCondition := psuc.newCondition.DeepCopy()
|
||||
psuc.lock.Unlock()
|
||||
|
||||
podCopy := pod.DeepCopy()
|
||||
// Sync passed pod's status with the call's condition and nominatingInfo.
|
||||
synced := syncStatus(&podCopy.Status, psuc.newCondition, psuc.nominatingInfo)
|
||||
synced := syncStatus(&podCopy.Status, newCondition, psuc.nominatingInfo)
|
||||
if !synced {
|
||||
return pod, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user