Skip to content

Commit

Permalink
rename variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentportella committed Aug 13, 2024
1 parent 5e8160c commit 659206b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/cyclenoderequest/transitioner/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ func (t *CycleNodeRequestTransitioner) getNodesToTerminate(numNodes int64) (node
// addNamedNodesToTerminate adds the named nodes for this CycleNodeRequest to the list of nodes to terminate.
// Skips any named node that does not exist in the node group for this CycleNodeRequest.
func (t *CycleNodeRequestTransitioner) addNamedNodesToTerminate(kubeNodes map[string]corev1.Node, nodeGroupInstances map[string]cloudprovider.Instance) error {
kubeNodesMap := make(map[string]corev1.Node)
nodeLookupByName := make(map[string]corev1.Node)

for _, node := range kubeNodes {
kubeNodesMap[node.Name] = node
nodeLookupByName[node.Name] = node
}

for _, namedNode := range t.cycleNodeRequest.Spec.NodeNames {
kubeNode, found := kubeNodesMap[namedNode]
kubeNode, found := nodeLookupByName[namedNode]

if !found {
t.rm.Logger.Info("could not find node by name, skipping", "nodeName", namedNode)
Expand Down

0 comments on commit 659206b

Please sign in to comment.