feat: recover PVC browsing when container tools are missing - #609
Merged
Merged
Conversation
Try compatible running mounts after a missing-tool error, then offer a confirmed helper. Preserve subdirectory and read-only limits, check volume access modes before creation, and retain errors when recovery is blocked. Closes #607
Greptile SummaryThis PR adds automatic recovery when the initial PVC browser target lacks required listing tools.
Confidence Score: 5/5The PR appears safe to merge, with no concrete correctness, security, or repository-rule violations identified. Recovery is limited to specifically recognized missing-tool failures, preserves mount boundaries and read-only state, revalidates authorization and access constraints before helper creation, and cleans up temporary helpers. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Initial PVC listing] --> B{Listing succeeded?}
B -- Yes --> C[Display directory]
B -- No --> D{Missing sh, ls, or head?}
D -- No --> E[Display original error]
D -- Yes --> F[Load pods and PVC access modes]
F --> G[Try up to 16 compatible mounts]
G --> H{Candidate succeeds?}
H -- Yes --> C
H -- No, candidates remain --> G
H -- No candidates --> I{Helper allowed and safe?}
I -- No --> E
I -- Yes --> J[Ask for confirmation]
J -- Cancel --> E
J -- Accept --> K[Recheck guardrails and access]
K --> L{Still allowed?}
L -- No --> E
L -- Yes --> M[Create constrained helper pod]
M --> N[Browse PVC]
N --> O[Delete helper when browser closes]
Reviews (1): Last reviewed commit: "feat: recover PVC browsing when containe..." | Re-trigger Greptile |
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.
When the first PVC listing fails because
sh,ls, orheadis missing, sofka now tries compatible running containers and then offers a helper pod. The original error remains available if recovery is canceled or blocked.Recovery preserves static subdirectory mounts and read-only restrictions. A helper for an in-use
ReadWriteOnceclaim is scheduled on the consumer's node. An occupiedReadWriteOncePodclaim is refused before creation. Access restrictions are checked again after confirmation. Permission errors and connection failures do not trigger missing-tool recovery.Closes #607.
Agreed discussion: #604 (comment)
Validation:
just checkpassed withRUST_TEST_THREADS=1. The final commit hooks passed formatting, clippy, and the full test suite. Tests cover candidate selection, confirmation and cancellation, retained errors, mount restrictions, and helper creation and cleanup through a mock Kubernetes API.just fmt-checkalso passed after the hooks.Limits: automatic recovery tries at most 16 alternative mounts and cannot recover a
subPathExprmount without a known boundary. No live-cluster test was run.