Skip to content

Commit c8ec98e

Browse files
committed
refact: cacheexpectation expect delete
1 parent ef81885 commit c8ec98e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

controller/expectations/cache_expectation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ func (e *CacheExpectation) deletionObserved(gvk schema.GroupVersionKind, namespa
256256
}
257257
err = e.reader.Get(context.Background(), types.NamespacedName{Namespace: namespace, Name: name}, cObj)
258258
if err == nil {
259-
return false
259+
// treat object as deleted if it has a deletion timestamp
260+
return cObj.GetDeletionTimestamp() != nil
260261
}
261262
return errors.IsNotFound(err)
262263
}

0 commit comments

Comments
 (0)