Skip to content

Commit b030be3

Browse files
authored
Merge pull request kubernetes#89581 from Wenfeng-GAO/simplify
simplify code in topologymanager
2 parents 7bd48eb + 1aebbee commit b030be3

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

pkg/kubelet/cm/topologymanager/policy_restricted.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ func (p *restrictedPolicy) Name() string {
3535
}
3636

3737
func (p *restrictedPolicy) canAdmitPodResult(hint *TopologyHint) bool {
38-
if !hint.Preferred {
39-
return false
40-
}
41-
return true
38+
return hint.Preferred
4239
}
4340

4441
func (p *restrictedPolicy) Merge(providersHints []map[string][]TopologyHint) (TopologyHint, bool) {

pkg/kubelet/cm/topologymanager/policy_single_numa_node.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ func (p *singleNumaNodePolicy) Name() string {
4040
}
4141

4242
func (p *singleNumaNodePolicy) canAdmitPodResult(hint *TopologyHint) bool {
43-
if !hint.Preferred {
44-
return false
45-
}
46-
return true
43+
return hint.Preferred
4744
}
4845

4946
// Return hints that have valid bitmasks with exactly one bit set.

0 commit comments

Comments
 (0)