Skip to content

feat: recover PVC browsing when container tools are missing - #609

Merged
nklmilojevic merged 1 commit into
mainfrom
feat/pvc-tool-recovery
Sep 16, 2026
Merged

nklmilojevic merged 1 commit into
mainfrom
feat/pvc-tool-recovery

Conversation

@nklmilojevic

Copy link
Copy Markdown
Owner

When the first PVC listing fails because sh, ls, or head is 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 ReadWriteOnce claim is scheduled on the consumer's node. An occupied ReadWriteOncePod claim 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 check passed with RUST_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-check also passed after the hooks.

Limits: automatic recovery tries at most 16 alternative mounts and cannot recover a subPathExpr mount without a known boundary. No live-cluster test was run.

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-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds automatic recovery when the initial PVC browser target lacks required listing tools.

  • Detects missing sh, ls, and head without treating permission or connectivity errors as tool failures.
  • Tries compatible running containers before offering a temporary helper pod.
  • Preserves static subpaths and read-only restrictions while handling ReadWriteOnce and ReadWriteOncePod placement constraints.
  • Rechecks guardrails and access restrictions after confirmation and retains the original error when recovery cannot proceed.
  • Adds application, Kubernetes API, lifecycle, rendering, and unit coverage plus user-facing documentation.

Confidence Score: 5/5

The 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
Filename Overview
src/pvcexplore.rs Adds missing-tool detection, complete mount enumeration, recovery planning, and helper constraints for subpaths, read-only access, and exclusive claims.
src/app/pvcexplore.rs Implements the asynchronous recovery lifecycle, candidate fallback, confirmation flow, restriction rechecks, helper creation, and retained error handling.
src/app/lifecycle.rs Routes recovery results through generation-aware application message handling.
src/app/tests.rs Adds broad coverage for candidate selection, cancellation, restrictions, stale results, helper revalidation, manifest construction, and cleanup.
src/ui.rs Wraps multiline PVC recovery errors so retained failure details remain readable in the remote pane.
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]
Loading

Reviews (1): Last reviewed commit: "feat: recover PVC browsing when containe..." | Re-trigger Greptile

@nklmilojevic
nklmilojevic merged commit c5abe55 into main Sep 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: offer PVC browsing recovery when container tools are missing

1 participant