recovery: align xpu-smi use in reset and reflash Jobs - #120
Merged
Conversation
Don't assume xpu-smi's location in the image and use shell to find it. Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently align reset/reflash Job execution with sh -c semantics, add input allow-listing where needed, and include targeted test coverage for the new contract.
Pull request overview
This PR updates GPU recovery Jobs to invoke xpu-smi via /bin/sh -c so the operator does not assume a fixed install path for xpu-smi inside the referenced image, and corrects the reflash Job invocation semantics for sh -c.
Changes:
- Switch reset Job execution to
/bin/sh -cand pass a single command-line string soxpu-smiis resolved onPATH. - Fix reflash Job invocation so
sh -creceives one command string (avoiding the prior argv/positional-parameter pitfall). - Add strict BDF shape validation to prevent interpolating untrusted device identifiers into a privileged shell command line, with accompanying tests and docs.
File summaries
| File | Description |
|---|---|
RECOVERY.md |
Documents the /bin/sh -c contract and PATH requirement for xpu-smi images. |
internal/controller/gpurecoveryplan_helpers.go |
Introduces BDF allow-list validation and switches reset/reflash command builders to return shell command strings. |
internal/controller/gpurecoveryplan_controller.go |
Enforces BDF validation during detection and updates reset/reflash Job arg injection to match sh -c semantics. |
internal/controller/gpurecoveryplan_controller_test.go |
Adds/updates tests for BDF validation and the one-arg sh -c “shell contract” for both Job templates. |
config/deployments/xpum/xpum-reset-job.yaml |
Updates the reset Job template to run /bin/sh -c with a single command-line argument. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
pfl
approved these changes
Sep 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Don't assume xpu-smi's location in the image and use shell to find it. Also fixes invalid xpu-smi call in the reflash container.