-
Notifications
You must be signed in to change notification settings - Fork 501
add priority class to wl none -> some #8480
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
base: main
Are you sure you want to change the base?
Changes from all commits
52a3e03
960d7d3
a2a18f9
4c6a28a
dd27de7
076aa7a
ca335de
79d6a4b
116e539
03674a6
1e72145
efdabfb
023b1e7
ea8d6c7
399845c
6abdbb3
57b8205
1e78b9e
9896790
fe2ba6f
d0098d8
c29aa7d
543282c
e49c14d
d7d305b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,11 +154,13 @@ func validatedUpdateForEnabledWorkloadSlice(oldJob, newJob GenericJob) field.Err | |
| } | ||
|
|
||
| func ValidateUpdateForWorkloadPriorityClassName(isSuspended bool, oldObj, newObj client.Object) field.ErrorList { | ||
| // Cannot ADD a priority class to a NON-suspended (running) workload && wpc is empty | ||
|
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. If we want to support adding a priority class, I think we should allow it.
Contributor
Author
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. as far as I understand the issue mentioned suspended workloads, this piece of code is only affecting running on. If we change this if condition, it means we allow priority change to running workloads (if I get the code right?)
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. Ah, I see, you right, we want to fix only suspended workloads. |
||
| if !isSuspended && IsWorkloadPriorityClassNameEmpty(oldObj) { | ||
| if !IsWorkloadPriorityClassNameEmpty(newObj) { | ||
| return field.ErrorList{field.Invalid(workloadPriorityClassNamePath, WorkloadPriorityClassName(newObj), "WorkloadPriorityClass cannot be added to a non-suspended workload")} | ||
| } | ||
| } | ||
| // Cannot REMOVE a priority class from a workload (regardless of suspended/running) | ||
| if IsWorkloadPriorityClassNameEmpty(newObj) { | ||
| if !IsWorkloadPriorityClassNameEmpty(oldObj) { | ||
| return field.ErrorList{field.Invalid(workloadPriorityClassNamePath, WorkloadPriorityClassName(newObj), "WorkloadPriorityClass cannot be removed from a workload")} | ||
|
|
||
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.
It would also be great to add a test case where we change the priority value. It should work only for WorkloadPriorityClass.
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.
this got me thinking, is there a case where Kind changed from PodPriority to WorkloadPriority but uses same name? do we need to cover that?
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.
Yeah, it would be great to cover this case as well.