Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Smith <[email protected]>
  • Loading branch information
robertdavidsmith committed Dec 30, 2024
1 parent 0cf3067 commit eb034ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/scheduler/internaltypes/node_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type NodeFactory struct {
resourceListFactory *ResourceListFactory

// Used for assigning node index
nodeIndexCounter uint64
nodeIndexCounter atomic.Uint64
}

func NewNodeFactory(
Expand All @@ -43,7 +43,7 @@ func NewNodeFactory(
indexedTaints: util.StringListToSet(indexedTaints),
indexedNodeLabels: util.StringListToSet(indexedNodeLabels),
resourceListFactory: resourceListFactory,
nodeIndexCounter: 0,
nodeIndexCounter: atomic.Uint64{},
}
}

Expand Down Expand Up @@ -152,5 +152,5 @@ func (f *NodeFactory) AddTaints(nodes []*Node, extraTaints []v1.Taint) []*Node {
}

func (f *NodeFactory) allocateNodeIndex() uint64 {
return atomic.AddUint64(&f.nodeIndexCounter, 1)
return f.nodeIndexCounter.Add(1)
}

0 comments on commit eb034ca

Please sign in to comment.