mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-08 14:29:45 +00:00
prevent predicatesOrdering
from escaping from UT
- sets `predicatesOrdering` back to original value in UT
This commit is contained in:
@@ -77,3 +77,13 @@ func portsConflict(existingPorts schedulernodeinfo.HostPortInfo, wantPorts []*v1
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPredicatesOrderingDuringTest sets the predicatesOrdering to the specified
|
||||
// value, and returns a function that restores the original value.
|
||||
func SetPredicatesOrderingDuringTest(value []string) func() {
|
||||
origVal := predicatesOrdering
|
||||
predicatesOrdering = value
|
||||
return func() {
|
||||
predicatesOrdering = origVal
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user