Skip pods and replica sets marked for deletion

Fixes #44144
This commit is contained in:
Łukasz Oleś
2017-04-06 12:57:39 +02:00
parent bbedf9e71e
commit b9611b95f4
2 changed files with 24 additions and 0 deletions

View File

@@ -113,6 +113,10 @@ func (m *baseControllerRefManager) claimObject(obj metav1.Object, match func(met
// Ignore if we're being deleted or selector doesn't match.
return false, nil
}
if obj.GetDeletionTimestamp() != nil {
// Ignore if the object is being deleted
return false, nil
}
// Selector matches. Try to adopt.
if err := adopt(obj); err != nil {
// If the pod no longer exists, ignore the error.