-
Notifications
You must be signed in to change notification settings - Fork 616
Refactor FlavorAssigner #3536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:main
from
gabesaba:refactor_flavor_assigner
Nov 14, 2024
Merged
Refactor FlavorAssigner #3536
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -17,7 +17,6 @@ limitations under the License. | |
| package flavorassigner | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "testing" | ||
|
|
||
| "github.com/go-logr/logr" | ||
|
|
@@ -254,7 +253,7 @@ func TestAssignFlavors(t *testing.T) { | |
| }, | ||
| Status: &Status{ | ||
| reasons: []string{ | ||
| "insufficient quota for memory in flavor b_one in ClusterQueue", | ||
| "insufficient quota for memory in flavor b_one, request > maximum capacity (10Mi > 1Mi)", | ||
| }, | ||
| }, | ||
| Count: 1, | ||
|
|
@@ -366,9 +365,9 @@ func TestAssignFlavors(t *testing.T) { | |
| }, | ||
| Status: &Status{ | ||
| reasons: []string{ | ||
| "insufficient unused quota in cohort for cpu in flavor one, 1 more needed", | ||
| "insufficient unused quota in cohort for memory in flavor two, 5Mi more needed", | ||
| "insufficient unused quota in cohort for example.com/gpu in flavor b_one, 1 more needed", | ||
| "insufficient quota for cpu in flavor one, request > maximum capacity (3 > 2)", | ||
| "insufficient unused quota for memory in flavor two, 5Mi more needed", | ||
| "insufficient unused quota for example.com/gpu in flavor b_one, 1 more needed", | ||
| }, | ||
| }, | ||
| Count: 1, | ||
|
|
@@ -407,8 +406,8 @@ func TestAssignFlavors(t *testing.T) { | |
| }, | ||
| Status: &Status{ | ||
| reasons: []string{ | ||
| "insufficient quota for cpu in flavor one in ClusterQueue", | ||
| "insufficient quota for memory in flavor two in ClusterQueue", | ||
| "insufficient quota for cpu in flavor one, request > maximum capacity (3 > 2)", | ||
| "insufficient quota for memory in flavor two, request > maximum capacity (10Mi > 5Mi)", | ||
| }, | ||
| }, | ||
| Count: 1, | ||
|
|
@@ -836,7 +835,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourceCPU: resource.MustParse("2"), | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 1 more needed"}, | ||
| reasons: []string{"insufficient quota for cpu in flavor one, request > maximum capacity (2 > 1)"}, | ||
| }, | ||
| Count: 1, | ||
| }}, | ||
|
|
@@ -882,7 +881,7 @@ func TestAssignFlavors(t *testing.T) { | |
| }, | ||
|
|
||
| Status: &Status{ | ||
| reasons: []string{"borrowing limit for cpu in flavor one exceeded"}, | ||
| reasons: []string{"insufficient unused quota for cpu in flavor one, 1 more needed"}, | ||
| }, | ||
| Count: 1, | ||
| }}, | ||
|
|
@@ -963,7 +962,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourceCPU: resource.MustParse("2"), | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 2 more needed"}, | ||
| reasons: []string{"insufficient unused quota for cpu in flavor one, 2 more needed"}, | ||
| }, | ||
| Count: 1, | ||
| }}, | ||
|
|
@@ -1080,7 +1079,7 @@ func TestAssignFlavors(t *testing.T) { | |
| }, | ||
| Status: &Status{ | ||
| reasons: []string{ | ||
| "insufficient quota for cpu in flavor one in ClusterQueue", | ||
| "insufficient quota for cpu in flavor one, request > maximum capacity (12 > 4)", | ||
| "insufficient unused quota for cpu in flavor tainted, 3 more needed", | ||
| }, | ||
| }, | ||
|
|
@@ -1176,7 +1175,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourcePods: resource.MustParse("3"), | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{fmt.Sprintf("insufficient quota for %s in flavor default in ClusterQueue", corev1.ResourcePods)}, | ||
| reasons: []string{"insufficient quota for pods in flavor default, request > maximum capacity (3 > 2)"}, | ||
| }, | ||
| Count: 3, | ||
| }}, | ||
|
|
@@ -1504,7 +1503,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourceCPU: {Name: "one", Mode: Preempt, TriedFlavorIdx: 0}, | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 10 more needed"}, | ||
| reasons: []string{"insufficient unused quota for cpu in flavor one, 10 more needed"}, | ||
| }, | ||
| Requests: corev1.ResourceList{ | ||
| corev1.ResourceCPU: resource.MustParse("12"), | ||
|
|
@@ -1561,7 +1560,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourceCPU: {Name: "one", Mode: Preempt, TriedFlavorIdx: 0}, | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 10 more needed"}, | ||
| reasons: []string{"insufficient unused quota for cpu in flavor one, 10 more needed"}, | ||
| }, | ||
| Requests: corev1.ResourceList{ | ||
| corev1.ResourceCPU: resource.MustParse("12"), | ||
|
|
@@ -1660,7 +1659,7 @@ func TestAssignFlavors(t *testing.T) { | |
| { | ||
| Name: "main", | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 11 more needed"}, | ||
| reasons: []string{"insufficient quota for cpu in flavor one, request > maximum capacity (12 > 11)"}, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually showing the message is fixed |
||
| }, | ||
| Requests: corev1.ResourceList{ | ||
| corev1.ResourceCPU: resource.MustParse("12"), | ||
|
|
@@ -1813,7 +1812,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourcePods: resource.MustParse("1"), | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 1 more needed"}, | ||
| reasons: []string{"insufficient unused quota for cpu in flavor one, 1 more needed"}, | ||
| }, | ||
| Count: 1, | ||
| }}, | ||
|
|
@@ -1861,7 +1860,7 @@ func TestAssignFlavors(t *testing.T) { | |
| corev1.ResourceCPU: {Name: "one", Mode: Preempt, TriedFlavorIdx: 0}, | ||
| }, | ||
| Status: &Status{ | ||
| reasons: []string{"insufficient unused quota in cohort for cpu in flavor one, 10 more needed"}, | ||
| reasons: []string{"insufficient unused quota for cpu in flavor one, 10 more needed"}, | ||
| }, | ||
| Requests: corev1.ResourceList{ | ||
| corev1.ResourceCPU: resource.MustParse("12"), | ||
|
|
||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to set this message even if
val <= rQuota.Nominal?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did this (a similar message) before, and I think the message is still relevant/accurate - other quota is being used