Fix removing finalizer for garbage collector

The loop should use 'continue' not 'break', otherwise removeFinalizer()
not only removes "orphaningFinalizer" from its finalizers list but
also removes others.
This commit is contained in:
FengyunPan 2017-06-29 17:22:03 +08:00
parent 343d751bc5
commit 23a90a7679

View File

@ -115,7 +115,7 @@ func (gc *GarbageCollector) removeFinalizer(owner *node, targetFinalizer string)
for _, f := range finalizers {
if f == targetFinalizer {
found = true
break
continue
}
newFinalizers = append(newFinalizers, f)
}