toolchain

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: 2 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.

README

toolchain

The seam by which a resolved toolchain payload is delivered into a sandbox pod, plus the resolution that produces it.

Package Purpose
kinds The delivery mechanisms and their registry.
resolve Turns a class's toolchain names into self-contained, frozen mounts plus a set digest.

toolchain.go holds the Kind interface, dispatched by SpiceboxToolchain.spec.source.kind, and ApplyParams. The pod builder owns the volume name and the init-container mount path, so a Kind never invents its own layout, and the shared SecurityContext pointer must be treated as read-only.

Constraints

  • Adding a delivery mechanism is a new package plus a blank import. An imagevolume kind (Kubernetes 1.36 + containerd 2.1) or a nix kind would leave pkg/platform/podspec and the controllers untouched.
  • resolve.Resolve is a pure function of the class and the cluster-scoped SpiceboxToolchain CRs: the same names always yield the same mounts and the same digest. That purity is what lets more than one controller call it without either importing the other.
  • Resolve fails closed on a missing or Valid=False toolchain, wrapping ErrToolchainMissing / ErrToolchainNotValid so the caller can pick the right Ready=False reason. Any other error — a transient apiserver failure — is returned wrapped by neither sentinel, so the caller propagates it instead of persisting a misleading condition.

Part of pkg/tools. See the root README.md and AGENTS.md.

Documentation

Overview

Package toolchain defines the pluggable seam by which a resolved toolchain payload is delivered into a sandbox pod. Today one Kind exists ("image": an initContainer that copies the payload into a shared emptyDir). A future "imagevolume" Kind (Kubernetes 1.36 + containerd 2.1) mounts the image directly with no copy, and a "nix" Kind mounts a merged content-addressed store. Adding either is a new package plus a blank import: pkg/platform/podspec and the controllers are untouched.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyParams

type ApplyParams struct {
	// Pod is mutated in place.
	Pod *corev1.Pod
	// Mount is the resolved toolchain (env already expanded).
	Mount spiceboxv1alpha1.ToolchainMount
	// VolumeName is the shared destination volume the sandbox container mounts
	// read-only at v1alpha1.ToolchainRootPath.
	VolumeName string
	// InitMountPath is where an init container should mount VolumeName
	// read-write. A Kind that needs no init container ignores it.
	InitMountPath string
	// SecurityContext must be applied to any container the Kind adds. The
	// pointer is shared across every container every Kind adds for this pod —
	// treat it as read-only, never mutate the pointee.
	SecurityContext *corev1.SecurityContext
}

ApplyParams carries everything a Kind needs to mutate the pod. The pod builder owns the volume name and the init-container mount path so that Kinds never invent their own layout.

type Kind

type Kind interface {
	// Name is the spec.source.kind value this Kind handles.
	Name() string
	// Validate checks the Kind-specific fields of a resolved mount.
	Validate(m spiceboxv1alpha1.ToolchainMount) error
	// Apply mutates p.Pod so the payload is present at
	// v1alpha1.ToolchainRootPath/<m.Name> in the sandbox container.
	Apply(p ApplyParams) error
}

Kind is one delivery mechanism, dispatched by SpiceboxToolchain spec.source.kind.

Directories

Path Synopsis
Package claude holds launcher-side logic specific to the "claude" toolchain (Claude Code, the inner coding agent running inside the sandbox).
Package claude holds launcher-side logic specific to the "claude" toolchain (Claude Code, the inner coding agent running inside the sandbox).
kinds
image
Package image delivers a toolchain payload by running the toolchain's own OCI image as an init container that copies the payload into a shared emptyDir, which the sandbox container then mounts read-only.
Package image delivers a toolchain payload by running the toolchain's own OCI image as an init container that copies the payload into a shared emptyDir, which the sandbox container then mounts read-only.
registry
Package registry is the process-local registry of toolchain delivery Kinds.
Package registry is the process-local registry of toolchain delivery Kinds.
Package resolve turns a class's toolchain names into self-contained, frozen mounts.
Package resolve turns a class's toolchain names into self-contained, frozen mounts.

Jump to

Keyboard shortcuts

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