diff --git a/pkg/controller/garbagecollector/garbagecollector_test.go b/pkg/controller/garbagecollector/garbagecollector_test.go index bfba3a314d4..994db10136e 100644 --- a/pkg/controller/garbagecollector/garbagecollector_test.go +++ b/pkg/controller/garbagecollector/garbagecollector_test.go @@ -272,7 +272,7 @@ func TestProcessEvent(t *testing.T) { var testScenarios = []struct { name string // a series of events that will be supplied to the - // GraphBuilder.eventQueue. + // GraphBuilder.graphChanges. events []event }{ { diff --git a/pkg/controller/garbagecollector/graph.go b/pkg/controller/garbagecollector/graph.go index 59b36c2ebfa..5ced32b7a97 100644 --- a/pkg/controller/garbagecollector/graph.go +++ b/pkg/controller/garbagecollector/graph.go @@ -34,8 +34,8 @@ func (s objectReference) String() string { return fmt.Sprintf("[%s/%s, namespace: %s, name: %s, uid: %s]", s.APIVersion, s.Kind, s.Namespace, s.Name, s.UID) } -// The single-threaded GraphBuilder.processEvent() is the sole writer of the -// nodes. The multi-threaded GarbageCollector.processItem() reads the nodes. +// The single-threaded GraphBuilder.processGraphChanges() is the sole writer of the +// nodes. The multi-threaded GarbageCollector.attemptToDeleteItem() reads the nodes. // WARNING: node has different locks on different fields. setters and getters // use the respective locks, so the return values of the getters can be // inconsistent. @@ -46,7 +46,7 @@ type node struct { // dependents are the nodes that have node.identity as a // metadata.ownerReference. dependents map[*node]struct{} - // this is set by processEvent() if the object has non-nil DeletionTimestamp + // this is set by processGraphChanges() if the object has non-nil DeletionTimestamp // and has the FinalizerDeleteDependents. deletingDependents bool deletingDependentsLock sync.RWMutex diff --git a/pkg/controller/garbagecollector/graph_builder.go b/pkg/controller/garbagecollector/graph_builder.go index 671db1e7c66..4f356667b4e 100644 --- a/pkg/controller/garbagecollector/graph_builder.go +++ b/pkg/controller/garbagecollector/graph_builder.go @@ -259,7 +259,7 @@ func (gb *GraphBuilder) enqueueChanges(e *event) { // addDependentToOwners adds n to owners' dependents list. If the owner does not // exist in the gb.uidToNode yet, a "virtual" node will be created to represent // the owner. The "virtual" node will be enqueued to the attemptToDelete, so that -// processItem() will verify if the owner exists according to the API server. +// attemptToDeleteItem() will verify if the owner exists according to the API server. func (gb *GraphBuilder) addDependentToOwners(n *node, owners []metav1.OwnerReference) { for _, owner := range owners { ownerNode, ok := gb.uidToNode.Read(owner.UID)