Documentation
¶
Overview ¶
Package sandboxrender turns an EmbeddedSandboxTemplate + overrides into the concrete Pool spec consumed by the SandboxPool controller.
Callers are:
- SandboxEnv Reconciler / SyncTemplate endpoint (renders member pools)
- any other path that needs to apply pool-level overrides on top of a template snapshot
The package intentionally returns plain errors (no domain.AppError) so the controller layer can use it without taking a service-package dependency; HTTP-layer callers wrap into domain.AppError at the boundary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(emb *agentsv1alpha1.EmbeddedSandboxTemplate, opts Options) error
Apply mutates emb in place by applying opts.
Errors are deterministic input-validation failures — the caller should surface them as 400 Bad Request. Apply does NOT mutate emb if it returns a non-nil error (best-effort: validation runs before mutation per field).
func ValidateContainerImage ¶
ValidateContainerImage checks that image is a syntactically valid Docker/OCI image reference (e.g. "nginx:1.25", "ghcr.io/org/repo@sha256:abc..."). Empty strings are silently accepted (callers skip empty images before calling this).
Types ¶
type Options ¶
type Options struct {
// Image overrides containers[0].image. Empty = no-op.
Image string
// InlineResources, when non-nil, replaces containers[0].resources with
// the given ResourceRequirements. Used when a Member declares its own
// resource sizing independent of the Template. Future work: when an
// InstanceType catalog provider is wired in, the Reconciler will
// resolve InstanceType + Multiplier to ResourceRequirements before
// calling Apply, so this field stays the single resource-sizing knob
// the renderer consumes.
InlineResources *corev1.ResourceRequirements
}
Options is the render-input for Apply. Caller composes the values from whatever source-of-truth they have (e.g. Env-level overrides for Image, Member-level InlineResources for per-Pool sizing).