mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Update filterHints to filterSingleNumaHints:
- Change function name - Remove policy parameter (unnecessary) - Update unit test to reflect change
This commit is contained in:
parent
3d8317ae91
commit
df9b2595f3
@ -55,7 +55,7 @@ func (p *singleNumaNodePolicy) canAdmitPodResult(hint *TopologyHint) lifecycle.P
|
||||
}
|
||||
|
||||
// Return hints that have valid bitmasks with exactly one bit set.
|
||||
func (p *singleNumaNodePolicy) filterHints(allResourcesHints [][]TopologyHint) [][]TopologyHint {
|
||||
func filterSingleNumaHints(allResourcesHints [][]TopologyHint) [][]TopologyHint {
|
||||
var filteredResourcesHints [][]TopologyHint
|
||||
for _, oneResourceHints := range allResourcesHints {
|
||||
var filtered []TopologyHint
|
||||
@ -108,7 +108,7 @@ func (p *singleNumaNodePolicy) mergeProvidersHints(providersHints []map[string][
|
||||
}
|
||||
|
||||
// Filter to only include don't cares and hints with a single NUMA node.
|
||||
allProviderHints = p.filterHints(allProviderHints)
|
||||
allProviderHints = filterSingleNumaHints(allProviderHints)
|
||||
|
||||
// Set the bestHint to return from this function as {nil false}.
|
||||
// This will only be returned if no better hint can be found when
|
||||
|
@ -155,10 +155,8 @@ func TestPolicySingleNumaNodeFilterHints(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
numaNodes := []int{0, 1, 2, 3}
|
||||
for _, tc := range tcases {
|
||||
policy := NewSingleNumaNodePolicy(numaNodes)
|
||||
actual := policy.(*singleNumaNodePolicy).filterHints(tc.allResources)
|
||||
actual := filterSingleNumaHints(tc.allResources)
|
||||
if !reflect.DeepEqual(tc.expectedResources, actual) {
|
||||
t.Errorf("Test Case: %s", tc.name)
|
||||
t.Errorf("Expected result to be %v, got %v", tc.expectedResources, actual)
|
||||
|
Loading…
Reference in New Issue
Block a user