podspec

package
v0.0.0-...-7c75ef6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package podspec builds a sandboxed corev1.Pod from a SpiceboxSession + resolved SpiceboxClass spec.

Index

Constants

View Source
const (
	// ContainerName is the name of the sandbox container in every pod this
	// package builds. Exported because the pod sandbox kind binds its exec
	// transport to this container.
	ContainerName = "sandbox"

	// SkillsMountPath is where staged skill bundles land in the sandbox: each
	// bundle unpacks to /skills/<LocalName>/ — the skill's own AgentSkill name,
	// which is what a disk-based consumer (Claude Code) looks for because it
	// must match the staged SKILL.md's frontmatter name (see
	// ResolvedSkillBundle.LocalName and BuildBundleSession in
	// pkg/controllers/agentsession/bundles.go). NOT <MountName>: that value is
	// only the Kubernetes-object-safe volume/ConfigMap name and is never the
	// sandbox-visible directory.
	//
	// Exported (rather than the package-private form the rest of this file's
	// constants use) so that internal/cmd/claudeshim/main.go — which needs the
	// same path to link staged skills into Claude Code's discovery path, and
	// today hand-duplicates the "/skills" literal under its own constant of
	// the same name — can import this one instead of re-typing the value.
	// Not wired up in this change: internal/cmd/claudeshim/ is out of scope
	// pending a separate architecture decision on the claudeshim/
	// toolchain-claude split.
	SkillsMountPath = "/skills"
)

Variables

This section is empty.

Functions

func Build

Build returns a Pod that implements the sandbox for the given Session. Returns an error if the class spec is missing fields the Pod requires.

func BuildClassSpec

BuildClassSpec renders the class-derived PodSpec: everything that does not depend on a particular session. This is exactly the shape a pre-warmed sandbox has, and comparing a session's PodSpec against it is how the agent-sandbox backend decides whether that session may adopt one.

toolchains is the already-RESOLVED mount list (see pkg/tools/toolchain/resolve), not class.Toolchains itself. Resolution is a pure function of the class, so a pool builder and a session reach this function with the same mounts for the same class and get byte-identical output — that equality IS the adoption test. Pass nil only for a class with no toolchains: passing nil for a class whose Toolchains is non-empty renders a spec missing the overlay, which no session that resolved those toolchains can ever compare equal to, so that pool entry becomes unadoptable.

func BuildSnapshotStorePVC

func BuildSnapshotStorePVC(sess *spiceboxv1alpha1.AgentSession, storageClass, size string) *corev1.PersistentVolumeClaim

BuildSnapshotStorePVC constructs the PVC the cp-by-pod Snapshotter writes snapshot subdirectories into. Owner-ref'd to the AgentSession so K8s GC deletes it when the session is deleted (same lifecycle as the workspace PVC).

ReadWriteOnce, matching the workspace PVC: under the bundled nodePathMap provisioner each PV carries nodeAffinity, and the snapshot/restore copy jobs mount workspace + snapstore in one pod — the shared nodeAffinity co-locates that pod and both PVCs on one node, where RWO permits the concurrent mounts.

func HardenedContainerSecurityContext

func HardenedContainerSecurityContext() *corev1.SecurityContext

HardenedContainerSecurityContext returns the container-level security context applied to both the sandbox container and the runner container.

func HardenedPodSecurityContext

func HardenedPodSecurityContext() *corev1.PodSecurityContext

HardenedPodSecurityContext returns the pod-level security context applied to both the sandbox pod (Build) and the runner pod (BuildRunnerPod). Callers that need the service-account token (e.g. the runner) must leave AutomountServiceAccountToken at its default (nil / true); the sandbox pod sets it to false separately.

func PodNameFor

PodNameFor returns the deterministic Pod name for a given SpiceboxSession.

func SnapshotStoreClaimName

func SnapshotStoreClaimName(sess *spiceboxv1alpha1.AgentSession) string

SnapshotStoreClaimName is the deterministic name of the snapshot-store PVC paired with an AgentSession's workspace PVC. The snapshot store accumulates one subdirectory per JIT snapshot taken by the cp-by-pod Snapshotter.

func WorkspaceClaimName

func WorkspaceClaimName(sess *spiceboxv1alpha1.AgentSession) string

WorkspaceClaimName is the deterministic name of the PVC backing an AgentSession's shared workspace (ReadWriteOnce; see BuildWorkspacePVC).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL