Skip to content

Commit

Permalink
Prevent capacity no command sort by node role duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
akrzos committed Apr 3, 2021
1 parent 10b361f commit 61bfa8f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/capacity/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ var nodeCmd = &cobra.Command{
nodesCapacityData[node.Name].TotalAllocatableCPU.Add(*node.Status.Allocatable.Cpu())
nodesCapacityData[node.Name].TotalAllocatableMemory.Add(*node.Status.Allocatable.Memory())
nodesCapacityData[node.Name].TotalAllocatableEphemeralStorage.Add(*node.Status.Allocatable.StorageEphemeral())
for _, role := range roles.List() {
nodesByRole[role] = append(nodesByRole[role], node.Name)
}
rolesIndex := strings.Join(roles.List(), ",")
nodesByRole[rolesIndex] = append(nodesByRole[rolesIndex], node.Name)
}
nodesCapacityData["*unassigned*"] = new(output.NodeCapacityData)
nodesCapacityData["*total*"] = new(output.NodeCapacityData)
Expand Down

0 comments on commit 61bfa8f

Please sign in to comment.