mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Merge pull request #49980 from caesarxuchao/gc-minor
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899) GC shouldn't send empty patch The scope of the `if` statement was wrong, causing GC to sometimes send empty patch. Found this bug while investigating https://github.com/kubernetes/kubernetes/issues/49966.
This commit is contained in:
commit
cba21511bd
@ -390,9 +390,10 @@ func (gc *GarbageCollector) attemptToDeleteItem(item *node) error {
|
||||
switch {
|
||||
case len(solid) != 0:
|
||||
glog.V(2).Infof("object %s has at least one existing owner: %#v, will not garbage collect", solid, item.identity)
|
||||
if len(dangling) != 0 || len(waitingForDependentsDeletion) != 0 {
|
||||
glog.V(2).Infof("remove dangling references %#v and waiting references %#v for object %s", dangling, waitingForDependentsDeletion, item.identity)
|
||||
if len(dangling) == 0 && len(waitingForDependentsDeletion) == 0 {
|
||||
return nil
|
||||
}
|
||||
glog.V(2).Infof("remove dangling references %#v and waiting references %#v for object %s", dangling, waitingForDependentsDeletion, item.identity)
|
||||
// waitingForDependentsDeletion needs to be deleted from the
|
||||
// ownerReferences, otherwise the referenced objects will be stuck with
|
||||
// the FinalizerDeletingDependents and never get deleted.
|
||||
|
Loading…
Reference in New Issue
Block a user