Skip to content

docs(osep): propose secure PVC subpath initialization - #1579

Closed
cwj2001 wants to merge 5 commits into
opensandbox-group:mainfrom
cwj2001:feature/volume-subpath-initializer
Closed

docs(osep): propose secure PVC subpath initialization#1579
cwj2001 wants to merge 5 commits into
opensandbox-group:mainfrom
cwj2001:feature/volume-subpath-initializer

Conversation

@cwj2001

@cwj2001 cwj2001 commented Aug 19, 2026

Copy link
Copy Markdown

Problem

Kubernetes requires a volumeMount.subPath directory to exist before the Pod starts. A referenced PVC can be bound while a new task- or sandbox-specific subdirectory is absent, causing mount/startup failure. Creating that directory outside OpenSandbox requires separate credentials or a helper workload and cannot preserve a final read-only mount cleanly.

Proposal

  • Adds draft OSEP-0021 for opt-in, secure initialization of a missing Kubernetes PVC Volume.subPath.
  • Adds one default-off, mount-scoped field: Volume.createSubPathIfMissing.
  • Clarifies OSEP-0003: ordinary missing-subPath behavior is runtime-dependent; secure creation is explicit opt-in.

The initial boundary is Linux Kubernetes, an existing PVC, and non-Pool creation. The final mount remains read-only or read-write as requested. A server-owned, non-privileged init container performs descriptor-relative, no-follow creation; callers cannot supply an image, command, UID/GID/mode, or PodSpec fragment.

Relationship to OSEP-0020 / #1573

This is an independent proposal, not a modification or supersession claim. It deliberately uses a mount-scoped field, supports a read-only final mount, and makes old/mixed-version rollout fail closed through a capability-aware create path.

Review requested

Please review these design decisions before implementation:

  1. Is mount-scoped Volume.createSubPathIfMissing the right minimal public contract?
  2. Is a distinct capability-aware create route the right way to prevent older or mixed server replicas from silently ignoring the opt-in?
  3. Is the initial Kubernetes/Linux/PVC/non-Pool boundary appropriate?
  4. Are the proposed stable error categories and remaining HTTP-status mapping suitable for the Lifecycle API?

Compatibility and non-goals

  • Existing requests are unchanged; the option is additive and default-off.
  • Pool, Docker, and other backends fail explicitly rather than falling back.
  • PVC provisioning/deletion, permission repair, generic lifecycle hooks, and direct client Kubernetes access are out of scope.
  • This PR intentionally contains no implementation, schema, SDK, or generated-code changes.

Validation

  • git diff --check

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 19, 2026
@cwj2001 cwj2001 closed this Aug 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f947602ade

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +109 to +111
1. The only public option introduced by this OSEP is
`Volume.createSubPathIfMissing: boolean`, beside `subPath`, with default
`false`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reconcile the extra route with the sole-option requirement

The requirement says this boolean is the only public option introduced, but the normative rollout contract later adds both /v1/sandboxes/capability-aware-create and OpenSandbox-Required-Capability. Implementers therefore cannot satisfy both sections: either they expand the public protocol contrary to this requirement or omit the mechanism required for mixed-version safety. Define the route and header as part of the public interface here, or redesign negotiation so the field truly is the only addition.

AGENTS.md reference: AGENTS.md:L117-L120

Useful? React with 👍 / 👎.

Comment on lines +364 to +368
Retryability must be explicit through the existing transport semantics rather
than a new response property. The proposed distinction is a client-fix or
unsupported result in the existing 4xx class and a transient provider failure
in the existing 5xx class, but the final HTTP status mapping is a maintainer
decision. The `code`/`message` envelope remains unchanged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Specify the retryability mapping before implementation

When initialization fails, permanent permission/policy errors and transient storage/I/O errors all use VOLUME_SUBPATH_INITIALIZATION_FAILED, so clients can distinguish them only through the HTTP status; however, this section makes retryability mandatory while deferring that status mapping to a later decision. Consequently an implementation cannot satisfy requirement 9 or the test plan's “correct retryability” assertion without inventing protocol behavior that other implementations may choose differently. Make the stable 4xx/5xx mapping part of this contract.

AGENTS.md reference: AGENTS.md:L117-L120

Useful? React with 👍 / 👎.

status: draft
---

# OSEP-0021: Secure Initialization of Missing PVC Volume SubPaths

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add OSEP-0021 to the proposal index

Adding this proposal without updating oseps/README.md leaves the directory's stated “complete list” ending at OSEP-0019, even though drafts are included there. As a result, readers using the repository's OSEP entry point cannot discover OSEP-0021; add its title, draft status, and update date to that table.

Useful? React with 👍 / 👎.

@cwj2001 cwj2001 reopened this Aug 20, 2026
@cwj2001 cwj2001 closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant