Skip to content

fix(framework): validate all ReplicatedJobs in Volcano priorityClassName check - #3918

Open
Abhishek86798 wants to merge 1 commit into
kubeflow:masterfrom
Abhishek86798:fix/volcano-priority-class-validation-loop
Open

fix(framework): validate all ReplicatedJobs in Volcano priorityClassName check#3918
Abhishek86798 wants to merge 1 commit into
kubeflow:masterfrom
Abhishek86798:fix/volcano-priority-class-validation-loop

Conversation

@Abhishek86798

Copy link
Copy Markdown

What this PR does / why we need it

Volcano.Validate iterates jobSetSpec.ReplicatedJobs to check each job's priorityClassName. When a ReplicatedJob used a reserved priority class (system-cluster-critical or system-node-critical), the loop returned early instead of continuing to the next job, so validation was silently skipped for every ReplicatedJob listed after it.

This meant a TrainJob could be admitted with an invalid priorityClassName on a later ReplicatedJob, only surfacing as a pod scheduling failure at runtime instead of being rejected at admission time.

This PR:

  • changes the early return nil, allErrs to continue so each ReplicatedJob is validated independently;
  • adds table-driven test cases covering a reserved-priority job followed by an invalid one (should still error), and multiple reserved-priority jobs together (should produce no errors) — the existing suite only covered single-ReplicatedJob scenarios.

Validation

  • go build ./...
  • go vet ./...
  • go test ./pkg/runtime/framework/plugins/volcano/... -run TestValidate -v — all cases pass, including the two new ones.

Fixes #3917

Copilot AI balanced review requested due to automatic review settings August 14, 2026 15:35
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign electronic-waste for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot requested a review from robert-bell August 14, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Abhishek86798 Abhishek86798 changed the title fix(webhook): validate all ReplicatedJobs in Volcano priorityClassName check fix(framework): validate all ReplicatedJobs in Volcano priorityClassName check Aug 14, 2026
…ame check

Volcano.Validate returned early when a ReplicatedJob used a reserved
priority class (system-cluster-critical or system-node-critical),
skipping priorityClassName validation for every ReplicatedJob listed
after it. Use continue instead of an early return so each
ReplicatedJob is validated independently.

Fixes kubeflow#3917

Signed-off-by: Abhishek <abhikokadwar2@gmail.com>
@Abhishek86798
Abhishek86798 force-pushed the fix/volcano-priority-class-validation-loop branch from c4da52d to 81af251 Compare August 14, 2026 15:39
@github-project-automation github-project-automation Bot moved this to Needs Triage in Kubeflow Trainer Aug 21, 2026
@Abhishek86798

Copy link
Copy Markdown
Author

Friendly ping on this one — it's a small fix (early return inside a loop that should be continue, so priorityClassName validation is skipped for every ReplicatedJob after one using a reserved critical priority class), with table-driven test coverage for the multi-ReplicatedJob cases the existing suite didn't reach.

Happy to rebase or adjust if anything needs changing. cc @robert-bell @kuizhiqing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

bug(webhook): Volcano priorityClassName validation exits early, skipping later ReplicatedJobs

3 participants