fix(trainer): fallback to cluster-scoped runtime on 404 in get_runtime#341
fix(trainer): fallback to cluster-scoped runtime on 404 in get_runtime#341prabindersinghh wants to merge 1 commit intokubeflow:mainfrom
Conversation
|
🎉 Welcome to the Kubeflow SDK! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
…t test Signed-off-by: Prabinder Singh <prabindersinghh@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes Kubernetes backend get_runtime() so that a 404 from the namespaced TrainingRuntime lookup properly falls back to the cluster-scoped ClusterTrainingRuntime, aligning behavior with issue #335.
Changes:
- Update
get_runtime()to fall back to cluster-scoped runtime only on namespaced 404s. - Add a unit test to validate the 404 fallback behavior.
- Apply various formatting-only adjustments (line wrapping) in the Kubernetes backend module.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
kubeflow/trainer/backends/kubernetes/backend.py |
Adjusts get_runtime() exception handling to allow cluster fallback on namespaced 404. |
kubeflow/trainer/backends/kubernetes/backend_test.py |
Adds a unit test intended to assert the 404 fallback behavior. |
8f77bbe to
4c4cbb9
Compare
What this PR does
This PR fixes the
get_runtime()fallback behavior in the Kubernetes backend.Previously, when a namespaced
TrainingRuntimereturned a 404 error,get_runtime()could incorrectly raise an error instead of properlyfalling back to the cluster-scoped
ClusterTrainingRuntime.This change:
Fixes
Fixes #335
Checklist