Skip to content

Commit

Permalink
fix: serialize pod add/delete order
Browse files Browse the repository at this point in the history
(cherry picked from commit edaf41e)
  • Loading branch information
oilbeater committed Oct 25, 2021
1 parent 78dc1fb commit 765ede7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ func (c *Controller) handleDeletePod(pod *v1.Pod) error {
c.podKeyMutex.Lock(key)
defer c.podKeyMutex.Unlock(key)

if pod != nil && pod.DeletionTimestamp == nil && isPodAlive(pod) {
p, _ := c.podsLister.Pods(pod.Namespace).Get(pod.Name)
if p != nil && p.UID != pod.UID {
// Pod with same name exists, just return here
return nil
}
Expand Down

0 comments on commit 765ede7

Please sign in to comment.