Skip to content

Commit

Permalink
fix: serialize pod add/delete order
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 14, 2021
1 parent 530a3dd commit c3b72cf
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 @@ -473,7 +473,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 c3b72cf

Please sign in to comment.