Merge pull request #56221 from deads2k/gc-03-errors

Automatic merge from submit-queue (batch tested with PRs 52767, 55065, 55148, 56228, 56221). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

log errors while trying to GC resources

If GC can't update a finalizer, we need to see evidence of that failure.  This updates the code to log it.
This commit is contained in:
Kubernetes Submit Queue 2017-11-22 19:49:42 -08:00 committed by GitHub
commit 2f6e7bfc0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -559,14 +559,14 @@ func (gc *GarbageCollector) attemptToOrphanWorker() bool {
err := gc.orphanDependents(owner.identity, dependents)
if err != nil {
glog.V(5).Infof("orphanDependents for %s failed with %v", owner.identity, err)
utilruntime.HandleError(fmt.Errorf("orphanDependents for %s failed with %v", owner.identity, err))
gc.attemptToOrphan.AddRateLimited(item)
return true
}
// update the owner, remove "orphaningFinalizer" from its finalizers list
err = gc.removeFinalizer(owner, metav1.FinalizerOrphanDependents)
if err != nil {
glog.V(5).Infof("removeOrphanFinalizer for %s failed with %v", owner.identity, err)
utilruntime.HandleError(fmt.Errorf("removeOrphanFinalizer for %s failed with %v", owner.identity, err))
gc.attemptToOrphan.AddRateLimited(item)
}
return true