Kubernetes: Handle NotFound Errors in Garbage Collector
Problem
When objects were deleted externally (e.g., pods deleted directly after job deletion), the garbage collector logged errors. This was incorrect behavior since external deletion is a valid outcome, not an error.
The garbage collector was treating NotFound from deleteObject as an error condition instead of enqueuing a virtual delete event.
Solution
Added explicit NotFound error handling in attemptToDeleteItem. When deleteObject returns NotFound, the function now enqueues a virtual delete event, treating external deletion as a successful outcome.
This follows the same pattern already used when getObject returns NotFound, ensuring consistency across the function.
Result
Garbage collector handles externally deleted objects gracefully without error logging. Consistent behavior across all deletion paths.
Commit: kubernetes/kubernetes@ae3163e
Issue: #136525