-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve NodeInfo RunId calculation to handle NodeIdLabel (#2087)
* Improve NodeInfo RunId calculation to handle NodeIdLabel The server now expects us to report RunIds on a node if either: - The job is on the node and not "finished" - The legacy scheduler considers any pod that is not using resource as finished - The ExecutorApi considers and pod that it has told us to delete as finished - The job is not assigned to a node but has a node selector matching the node (using NodeIdLabel to match) * wip * Use schedulerobjects JobRunState everywhere * Fix tests * Tidy up * gofumt * missed change * Fix pr --------- Co-authored-by: Albin Severinson <albin@severinson.org>
- Loading branch information
1 parent
2da3dae
commit 99c89e3
Showing
23 changed files
with
961 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package schedulermocks | ||
|
||
import ( | ||
"sort" | ||
"strings" | ||
) | ||
|
||
type Stringer interface { | ||
String() string | ||
} | ||
|
||
type SliceMatcher[T Stringer] struct { | ||
Expected []T | ||
} | ||
|
||
// Matches | ||
// Matches input against provided expected input | ||
// This matching ignores the input ordering, so args don't need to be passed in a known order | ||
func (s SliceMatcher[T]) Matches(x interface{}) bool { | ||
inputs, ok := x.([]T) | ||
if !ok { | ||
return false | ||
} | ||
expected := s.Expected | ||
if len(inputs) != len(expected) { | ||
return false | ||
} | ||
sort.Slice(inputs, func(i, j int) bool { | ||
return strings.Compare(inputs[i].String(), inputs[j].String()) < 0 | ||
}) | ||
sort.Slice(expected, func(i, j int) bool { | ||
return strings.Compare(expected[i].String(), expected[j].String()) < 0 | ||
}) | ||
for i, inputValue := range inputs { | ||
if inputValue.String() != expected[i].String() { | ||
return false | ||
} | ||
} | ||
return true | ||
} | ||
|
||
// String describes what the matcher matches. | ||
func (s SliceMatcher[T]) String() string { | ||
return "checks provided matches expected uuid list" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.