feat(provider): add Sealos Devbox SSH-lease provider#682
Conversation
Register the sealos-devbox provider with typed config, flags, env/YAML loading, metadata, and a read-only doctor so the provider can be discovered and prerequisite-checked before mutating lifecycle work lands. Record the automation surface as crd_first based on Sealos CRD and SSHGate evidence while keeping lifecycle operations as explicit deferred stubs for later plans.
Implement the CRD-first Sealos DevBox lifecycle foundation behind the sealos-devbox adapter. This adds structured Devbox manifest rendering, fakeable kubectl helpers, scoped claims, status normalization, and Secret key persistence without exposing key material. The lifecycle stops at a prepared DevBox resource so later SSH/release/cleanup plans can add route construction, readiness, retained release, and cleanup behavior on top of a validated provider-local identity model.
Implement Sealos DevBox SSH target construction, readiness handoff, release behavior, and bounded cleanup behind the provider adapter.\n\nPublic-key SSHGate remains the default route, NodePort stays an explicit fallback, and cleanup/release paths validate identity before mutating resources.
Document the Sealos DevBox provider lifecycle, selection metadata, and live-smoke prerequisites. Add a guarded Sealos branch to the shared live-smoke harness so missing Kubernetes and route prerequisites classify as environment_blocked before mutation.
Roll back non-kept Sealos DevBox resources when post-create bootstrap fails, and make doctor report blocked when no image or templateID can create a DevBox. Keep untrusted config from redirecting Sealos cluster workload fields while preserving explicit delete-on-release policy.
Ensure sealos-devbox status --wait does not report ready until the SSH route is usable, matching the SSH lease readiness contract. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Only clear sealos-devbox local claim and SSH key state after a Kubernetes API NotFound confirms the DevBox is absent. Local kubectl execution failures now return to the caller so a missing binary or broken context cannot orphan a running DevBox.
Split Sealos DevBox validation so doctor can construct a read-only backend with incomplete route settings while lifecycle backend configuration still requires a usable SSHGate or NodePort route.
Call the acquire callback after the Sealos DevBox identity and SSH route are known but before local claim and key state are written, so controller-backed cleanup can track or reject the raw provider resource safely.
Require explicit yes output from kubectl auth can-i checks and force cleanup when controller identity acknowledgement rejects a newly acquired Sealos DevBox, even for kept acquisitions.
Allow Sealos DevBox release-only resolution to return the Kubernetes identity without requiring an SSH route, so stop/delete can proceed for NodePort DevBoxes whose status lacks an SSH endpoint.
Avoid Secret/key persistence during Sealos read-only resolution and reject scoped local claims whose live DevBox no longer matches the active provider scope.
Require a concrete Sealos DevBox image for CR creation and doctor readiness, while leaving templateID as optional metadata. Also decode Kubernetes-style lastContainerStatus objects so list/status reads handle real DevBox status payloads.
Resume paused Sealos DevBox leases before mutable SSH reuse paths fetch key material and wait for SSH. This preserves the default pause-on-release lifecycle while allowing later run and ssh commands to reuse retained leases.
Delay mutable SSH target construction until after a paused Sealos DevBox is resumed. This lets retained NodePort leases refresh their live route before Crabbox validates the SSH endpoint.
Reject Crabbox-labelled Sealos DevBoxes that lack the current provider_scope annotation. This keeps resolve, status, and release aligned with cleanup's exact scope boundary.
Check Kubernetes patch RBAC during doctor and refresh DevBox status while waiting for late-published SSH Secret names. This keeps Sealos preflight and acquisition aligned with the actual lifecycle operations.
Prefer explicit SSH NodePort fields or SSH-labelled port entries before falling back to generic numeric ports. This prevents Sealos NodePort routing from selecting preview or HTTP ports when multiple services are reported.
Allow release-only resolution to return a scoped local claim when Kubernetes confirms the Sealos DevBox is absent. This lets delete-on-release stop paths reach the existing stale claim and key cleanup branch.
Require doctor to confirm the DevBox CRD serves v1alpha2, and require NodePort SSH routing to come from SSH-specific status fields or port metadata instead of arbitrary exposed ports.
|
Codex review: needs real behavior proof before merge. Reviewed June 25, 2026, 2:22 AM ET / 06:22 UTC. Summary Reproducibility: not applicable. for the feature request itself; this is a new provider, not a broken existing behavior. For live behavior, no: the PR includes offline checks but no real Sealos run proving the provider path. Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the provider only after maintainers approve the Sealos provider contract and the contributor adds redacted live Sealos proof, or after maintainers explicitly waive that proof for a first landing. Do we have a high-confidence way to reproduce the issue? Not applicable for the feature request itself; this is a new provider, not a broken existing behavior. For live behavior, no: the PR includes offline checks but no real Sealos run proving the provider path. Is this the best way to solve the issue? Unclear pending maintainer approval and proof. The SSH-lease adapter is plausible and the raw remote-scope annotation exposure is addressed, but the provider should not merge without real Sealos proof or an explicit maintainer waiver. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0ec69d642764. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Drop unused Sealos helper functions left behind after the CRD lifecycle implementation so the CI deadcode gate passes.
Register the requested sealos and sealos-dev aliases for the Sealos DevBox provider and update registration coverage plus generated provider docs.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Wait for the expected terminal failure message as well as status in the pre-acquire cleanup test so the race-enabled CI run cannot observe an intermediate terminal record.
Store only non-sensitive Sealos provider-scope fingerprints on remote DevBox metadata and stop writing raw route fields to annotations. Release patches now remove legacy raw scope and route annotations while preserving local claim scope matching for existing DevBoxes.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Closes #365
Summary
Adds
sealos-devboxas a Crabbox Linux SSH-lease provider backed by Sealos DevBox lifecycle resources.This PR includes:
Verification
Local verification passed with:
Observed pass signals:
go test ./...passedgo vet ./...passednode --test scripts/live-smoke.test.jspassed with 51 pass, 0 failStructured review was run with Codex:
Result:
autoreview clean: no accepted/actionable findings reported.Config And Secret Notes