Skip to content

Commit 7df2bce

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#48269 from FengyunPan/add-gc-metric
Automatic merge from submit-queue (batch tested with PRs 48518, 48525, 48269) Update comment for garbagecollector Update comment for garbagecollector, update not exist func. **Release note**: ```release-note NONE ```
2 parents 3863f39 + 468b97a commit 7df2bce

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/controller/garbagecollector/garbagecollector_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func TestProcessEvent(t *testing.T) {
272272
var testScenarios = []struct {
273273
name string
274274
// a series of events that will be supplied to the
275-
// GraphBuilder.eventQueue.
275+
// GraphBuilder.graphChanges.
276276
events []event
277277
}{
278278
{

pkg/controller/garbagecollector/graph.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func (s objectReference) String() string {
3434
return fmt.Sprintf("[%s/%s, namespace: %s, name: %s, uid: %s]", s.APIVersion, s.Kind, s.Namespace, s.Name, s.UID)
3535
}
3636

37-
// The single-threaded GraphBuilder.processEvent() is the sole writer of the
38-
// nodes. The multi-threaded GarbageCollector.processItem() reads the nodes.
37+
// The single-threaded GraphBuilder.processGraphChanges() is the sole writer of the
38+
// nodes. The multi-threaded GarbageCollector.attemptToDeleteItem() reads the nodes.
3939
// WARNING: node has different locks on different fields. setters and getters
4040
// use the respective locks, so the return values of the getters can be
4141
// inconsistent.
@@ -46,7 +46,7 @@ type node struct {
4646
// dependents are the nodes that have node.identity as a
4747
// metadata.ownerReference.
4848
dependents map[*node]struct{}
49-
// this is set by processEvent() if the object has non-nil DeletionTimestamp
49+
// this is set by processGraphChanges() if the object has non-nil DeletionTimestamp
5050
// and has the FinalizerDeleteDependents.
5151
deletingDependents bool
5252
deletingDependentsLock sync.RWMutex

pkg/controller/garbagecollector/graph_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func (gb *GraphBuilder) enqueueChanges(e *event) {
259259
// addDependentToOwners adds n to owners' dependents list. If the owner does not
260260
// exist in the gb.uidToNode yet, a "virtual" node will be created to represent
261261
// the owner. The "virtual" node will be enqueued to the attemptToDelete, so that
262-
// processItem() will verify if the owner exists according to the API server.
262+
// attemptToDeleteItem() will verify if the owner exists according to the API server.
263263
func (gb *GraphBuilder) addDependentToOwners(n *node, owners []metav1.OwnerReference) {
264264
for _, owner := range owners {
265265
ownerNode, ok := gb.uidToNode.Read(owner.UID)

0 commit comments

Comments
 (0)