sandboxrender

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

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

func ValidateContainerImage(image string) error

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).

func (Options) Empty

func (o Options) Empty() bool

Empty returns true when Options carries no observable effect; callers can use this to skip rendering when no overrides apply.

Jump to

Keyboard shortcuts

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