modelhub

package
v0.7.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	GitSignCommits = "commits"
	GitSignTags    = "tags"
)

GitSignTarget enumerates the artefacts ContainerGit.Sign can enable signing for. Mirrors the v1beta1 constants.

View Source
const (
	RestartPolicyAlways    = "always"
	RestartPolicyOnFailure = "on-failure"
	RestartPolicyNever     = "never"
)

RestartPolicy values for ContainerSpec.RestartPolicy. Empty/unset is treated as RestartPolicyAlways at the runner gate — see ContainerSpec for the back-compat contract.

Variables

This section is empty.

Functions

func ApplySpaceDefaultsToContainer added in v0.2.0

func ApplySpaceDefaultsToContainer(space Space, container *ContainerSpec)

ApplySpaceDefaultsToContainer fills isolation fields on container that are unset (zero value or nil) using the defaults declared on space. Precedence:

container spec > Space defaults > kukeon built-in defaults

Inheritance is shallow — overriding a pointer/slice field replaces the Space default outright rather than deep-merging. For example, a Container that sets Capabilities.Drop=["CAP_NET_RAW"] replaces the Space default's Drop list entirely; it does not union with it.

The merge is idempotent: calling it twice on the same container yields the same result as calling it once.

Types

type Cell

type Cell struct {
	Metadata CellMetadata
	Spec     CellSpec
	Status   CellStatus
}

type CellBindingRef added in v0.6.0

type CellBindingRef struct {
	Name  string
	Realm string
	Space string
	Stack string
}

CellBindingRef mirrors v1beta1.CellBindingRef. Issue #1021.

type CellBlueprint added in v0.6.0

type CellBlueprint struct {
	Metadata CellBlueprintMetadata
	Document []byte
}

CellBlueprint is the internal carrier for a daemon-stored cell template (kind: CellBlueprint, issue #620). Unlike the hierarchy kinds it has no Status: a Blueprint has no runtime, and the daemon never interprets its body. The body travels as an opaque serialized Document — the direct analog of how Secret carries opaque Spec.Data — because the only daemon-side operations are "write this document under the scope" and "read it back"; materialization (scalar substitution + slot mapping) happens client-side in `kuke run -b`. Carrying a fully-typed mirror of the cell template here would duplicate the entire ContainerSpec conversion for no daemon-side benefit.

Metadata's scope coordinates are extracted from the document so the storage runner can resolve the on-disk path without parsing the body; Document holds the canonical serialized CellBlueprintDoc that GetBlueprint round-trips back out for materialization.

type CellBlueprintMetadata added in v0.6.0

type CellBlueprintMetadata struct {
	Name  string
	Realm string
	Space string
	Stack string
	// Labels lifts the blueprint document's metadata.labels onto the carrier
	// so daemon-side code can filter (`kukeon.io/team=<team>` for
	// per-team prune apply, #1027) without re-parsing the Document on every
	// access. ListBlueprints populates it; WriteBlueprint preserves it via
	// the Document round-trip — the labels travel inside the canonical
	// serialized doc, the carrier just lifts a typed view.
	Labels map[string]string
}

CellBlueprintMetadata identifies a Blueprint by name and the scope it binds to. A Blueprint is scopable at realm, space, or stack only — never cell. The scope is the deepest non-empty coordinate; a deeper coordinate requires every shallower one. See external v1beta1.CellBlueprintMetadata for the full contract.

type CellConfig added in v0.6.0

type CellConfig struct {
	Metadata CellConfigMetadata
	Document []byte
}

CellConfig is the internal carrier for a daemon-stored cell identity (kind: CellConfig, issue #624). Like CellBlueprint it has no Status and the daemon never interprets its body for storage: the canonical CellConfigDoc travels as an opaque serialized Document — the daemon writes it under the scope and reads it back. Scope coordinates are lifted onto the metadata so the storage runner can resolve the on-disk path without parsing the body. Apply-time slot-fill validation (which does need the body and the referenced blueprint) re-derives the typed view from Document via apischeme.

type CellConfigMetadata added in v0.6.0

type CellConfigMetadata struct {
	Name  string
	Realm string
	Space string
	Stack string
	// Labels lifts the config document's metadata.labels onto the carrier
	// so daemon-side code can filter (`kukeon.io/team=<team>` for per-team
	// prune apply, #1027) without re-parsing the Document on every access.
	// ListConfigs populates it; WriteConfig preserves it via the Document
	// round-trip — the labels travel inside the canonical serialized doc,
	// the carrier just lifts a typed view.
	Labels map[string]string
}

CellConfigMetadata identifies a Config by name and the scope it binds to. A Config is scopable at realm, space, or stack only — never cell. The scope is the deepest non-empty coordinate; a deeper coordinate requires every shallower one. See external v1beta1.CellConfigMetadata for the full contract.

type CellMetadata

type CellMetadata struct {
	Name   string
	Labels map[string]string
	// Annotations mirror v1beta1.CellMetadata.Annotations: non-identifying
	// metadata that round-trips through cell metadata but that no reconcile or
	// selector path keys off, and that DiffCell does not compare. Carries a
	// clone's `kukeon.io/source-cell` provenance annotation (#1073).
	Annotations map[string]string
	// Generation is a monotonic counter bumped by a writer on each
	// spec-changing update. Defaults to zero; phase 3 wires the writers to
	// populate it. See ObservedGeneration on the status.
	Generation int64
}

type CellNetworkStatus added in v0.3.0

type CellNetworkStatus struct {
	BridgeName string
}

CellNetworkStatus records the network endpoints the cell is attached to. BridgeName is the host-side Linux bridge derived via cni.SafeBridgeName from the cell's space network — persisting it lets `kuke describe`/ `kuke get cell -o yaml` recover the human→iface mapping without recomputing the hash.

type CellProvenance added in v0.6.0

type CellProvenance struct {
	BindingKind  string
	BindingRef   CellBindingRef
	Params       map[string]string
	EnvOverrides []string
}

CellProvenance mirrors v1beta1.CellProvenance. See that type for the field-by-field contract. Issue #1021.

func CloneCellProvenance added in v0.6.0

func CloneCellProvenance(in *CellProvenance) *CellProvenance

CloneCellProvenance deep-copies a *CellProvenance, returning nil for a nil input. Issue #1021.

type CellSpec

type CellSpec struct {
	ID              string
	RealmName       string
	SpaceName       string
	StackName       string
	RootContainerID string
	Tty             *CellTty
	Containers      []ContainerSpec
	// AutoDelete mirrors v1beta1.CellSpec.AutoDelete. See that type for
	// semantics; the field is round-tripped through cell metadata so the
	// daemon can re-derive the auto-delete intent after a restart.
	AutoDelete bool
	// NestedCgroupRuntime mirrors v1beta1.CellSpec.NestedCgroupRuntime. See
	// that type for semantics; the field is round-tripped through cell
	// metadata so the daemon can re-toggle the full subtree controller set
	// on the ensure-pass after a restart.
	NestedCgroupRuntime bool
	// RuntimeEnv mirrors v1beta1.CellSpec.RuntimeEnv. The wire side carries
	// `kuke run --env KEY=VALUE` from the CLI; the daemon merges these
	// entries into the attachable container's OCI process env at create /
	// start time. NOT persisted (v1beta1 has yaml:"-") — the runtime cell
	// metadata.yaml never carries it, so the disk-read paths
	// (validateAndGetCell, runner.GetCell) return cells with an empty
	// RuntimeEnv. Callers that drive a fresh start/recreate from a CLI
	// request preserve the field by copying cell.Spec.RuntimeEnv from the
	// inbound RPC cell onto the disk-read cell before the OCI build. See
	// runner.startCellLocked and Exec.createCellInternal. Issue #834.
	RuntimeEnv []string
	// Provenance mirrors v1beta1.CellSpec.Provenance: the persisted record of
	// the binding (Config or Blueprint) and the scalar params / env overrides
	// this cell was materialized from. Unlike RuntimeEnv it round-trips
	// through cell metadata so the reconciler can re-resolve the binding after
	// a restart. Nil for hand-built cells. DiffCell ignores it (lineage data,
	// not a runtime spec field). Issue #1021.
	Provenance *CellProvenance
	// IgnoreDiskPressure mirrors v1beta1.CellSpec.IgnoreDiskPressure. The wire
	// side carries `kuke create cell`/`kuke run --ignore-disk-pressure` from
	// the CLI; the runner's CreateCell guard reads it to bypass the data-volume
	// disk-pressure block. NOT persisted (v1beta1 has yaml:"-") — the override
	// is per-invocation, so the disk-read paths return cells with it false.
	// Issue #1035.
	IgnoreDiskPressure bool
}

type CellState

type CellState int
const (
	CellStatePending CellState = iota
	CellStateReady
	CellStateStopped
	CellStateFailed
	CellStateUnknown
	// CellStateExited is the clean self-exit terminal: every workload in the
	// cell exited 0 of its own accord (#1267). Distinct from CellStateStopped
	// (operator `kuke stop`/`kill`) and from CellStateError (a workload
	// crashed). Appended last to keep the ordinals in lockstep with the
	// v1beta1 CellState enum, which scheme.go converts by direct int cast.
	CellStateExited
	// CellStateError is the workload-crash terminal: at least one workload
	// exited non-zero (#1267). Inherits CellStateFailed's sticky / no-auto-
	// delete behavior, but reserves CellStateFailed for kukeon's own bring-up
	// failures. Appended last (after CellStateExited) for the same ordinal-
	// lockstep reason.
	CellStateError
)

type CellStatus

type CellStatus struct {
	State      CellState
	CgroupPath string
	// SubtreeControllers records the cgroup-v2 controllers actually
	// delegated on this cell's own cgroup.subtree_control after the
	// effective filter against the host root's cgroup.controllers
	// (issue #328). For NestedCgroupRuntime cells this carries the full
	// host-available set; for ordinary cells it carries the kukeon
	// resource subset (cgroupcheck.CellResourceControllers).
	SubtreeControllers []string
	Network            CellNetworkStatus
	Containers         []ContainerStatus
	// ReadyObserved is a one-way latch set the first time the cell has
	// been observed Ready by ReconcileCell — either via the freshly
	// derived state or via a persisted Ready state from a prior
	// observation (or a synchronous Start that wrote Ready before the
	// reconciler got there). The latch gates Spec.AutoDelete cleanup so
	// a cell that has never been Ready (e.g. mid-creation, between
	// cgroup setup and root-container registration, where
	// GetContainerState reports Stopped for a not-yet-existing
	// container) cannot be reaped by the reconciler.
	ReadyObserved bool
	// Lifecycle and runtime-health fields (issue #166). See
	// RealmStatus for the per-field contract.
	CreatedAt   time.Time
	UpdatedAt   time.Time
	ReadyAt     time.Time
	Reason      string
	Message     string
	CgroupReady bool
	// ObservedGeneration is the Metadata.Generation the reconciler last
	// acted on. Defaults to zero; phase 3 wires the reconciler to compare
	// it against Generation to skip stale work.
	ObservedGeneration int64
	// OutOfSync is true when the daemon's reconciler detects that this
	// cell's live spec has diverged from what its lineage Config would
	// materialize (issue #820, foundation phase of #819's umbrella). Only
	// set on cells carrying the kukeon.io/config lineage label; cells
	// without that label leave it false. OutOfSyncReason carries a short
	// human-readable summary when true. OutOfSyncError carries a distinct
	// failure surface when the reconciler could not compute divergence at
	// all (referenced Blueprint missing, materialization error) — when
	// non-empty, OutOfSync stays false because divergence is undecidable.
	OutOfSync       bool
	OutOfSyncReason string
	OutOfSyncError  string
}

type CellTty added in v0.3.0

type CellTty struct {
	Default string
}

CellTty mirrors the v1beta1 CellTty payload. See the v1beta1 type for field semantics.

type Container

type Container struct {
	Metadata ContainerMetadata
	Spec     ContainerSpec
	Status   ContainerStatus
}

type ContainerCapabilities added in v0.2.0

type ContainerCapabilities struct {
	Drop []string
	Add  []string
}

ContainerCapabilities groups Linux capability deltas applied relative to the image default set.

type ContainerGit added in v0.6.0

type ContainerGit struct {
	Author         *GitIdentity
	Committer      *GitIdentity
	SigningKey     string
	Sign           []string
	AllowedSigners string
}

ContainerGit mirrors the v1beta1 ContainerGit payload — declarative sugar over the GIT_AUTHOR_* / GIT_COMMITTER_* / GIT_CONFIG_* env-var protocol. See the v1beta1 type for field semantics. Issue #618.

type ContainerMetadata

type ContainerMetadata struct {
	Name   string
	Labels map[string]string
}

type ContainerRepo added in v0.6.0

type ContainerRepo struct {
	Name     string
	Target   string
	Branch   string
	Ref      string
	URL      string
	Required bool
}

ContainerRepo mirrors the v1beta1 ContainerRepo payload — a git repository the container depends on, cloned/fetched by kuketty pre-Serve. See the v1beta1 type for field semantics. Issue #617.

type ContainerResources added in v0.2.0

type ContainerResources struct {
	MemoryLimitBytes *int64
	CPUShares        *int64
	PidsLimit        *int64
}

ContainerResources exposes the cgroup v2 knobs supported per container.

type ContainerSecret added in v0.2.0

type ContainerSecret struct {
	Name      string
	FromFile  string
	FromEnv   string
	SecretRef *ContainerSecretRef
	MountPath string
}

ContainerSecret references a credential resolved by the daemon at apply time. Only the reference is persisted in the hub; the resolved value lives only in the OCI runtime spec (for env injection) or in the staged secret file (for mount mode). Exactly one source must be set: FromFile, FromEnv, or SecretRef (a daemon-managed kind: Secret, issue #623).

type ContainerSecretRef added in v0.6.0

type ContainerSecretRef struct {
	Name  string
	Realm string
	Space string
	Stack string
	Cell  string
}

ContainerSecretRef mirrors the v1beta1 ContainerSecretRef payload — a name + scope pointing at a daemon-managed kind: Secret (issue #619). See the v1beta1 type for the scope-coordinate contract. Issue #623.

type ContainerSpec

type ContainerSpec struct {
	ID              string
	ContainerdID    string
	RealmName       string
	SpaceName       string
	StackName       string
	CellName        string
	Root            bool
	Image           string
	Command         string
	Args            []string
	WorkingDir      string
	Env             []string
	Ports           []string
	Volumes         []VolumeMount
	Networks        []string
	NetworksAliases []string
	Privileged      bool
	HostNetwork     bool
	HostPID         bool
	HostCgroup      bool
	// NestedCgroupRuntime mirrors the parent cell's
	// CellSpec.NestedCgroupRuntime opt-in (issue #314). When true and
	// !HostCgroup, BuildContainerSpec/BuildRootContainerSpec append a
	// cgroup2 mount at /sys/fs/cgroup so an inner runtime (dockerd,
	// podman, an inner containerd) can read the controller set that
	// the controller delegated host-side via
	// EnableCellAllSubtreeControllers (#318). Propagated by the runner
	// from cell.Spec.NestedCgroupRuntime at every BuildContainerSpec
	// call site; not part of the persisted container document.
	NestedCgroupRuntime    bool
	User                   string
	ReadOnlyRootFilesystem bool
	Capabilities           *ContainerCapabilities
	SecurityOpts           []string
	// Devices mirrors the v1beta1 ContainerSpec.Devices payload — individual
	// host device nodes granted to the container (least-privilege alternative
	// to Privileged). Each entry is a host device path (short form, e.g.
	// "/dev/kvm") replicated at the same in-container path with "rwm" access.
	// BuildContainerSpec emits a Linux.Devices entry + Linux.Resources.Devices
	// allow rule per entry, stat'd from the host node at create time. Issue
	// #1252.
	Devices   []string
	Tmpfs     []ContainerTmpfsMount
	Resources *ContainerResources
	Secrets   []ContainerSecret
	// Repos mirrors the v1beta1 ContainerSpec.Repos payload — git
	// repositories kuketty clones/fetches in its pre-Serve step. See the
	// v1beta1 type for field semantics. Issue #617.
	Repos []ContainerRepo
	// Git mirrors the v1beta1 ContainerSpec.Git payload — declarative git
	// identity/signing sugar that BuildContainerSpec / BuildRootContainerSpec
	// expand into the GIT_AUTHOR_* / GIT_COMMITTER_* / GIT_CONFIG_* env block.
	// See the v1beta1 type for field semantics. Issue #618.
	Git           *ContainerGit
	CNIConfigPath string
	// RestartPolicy is the user-authored restart policy applied to the
	// container when its task exits. See the RestartPolicy* constants
	// below for the canonical values; the runner's wind-down/auto-delete
	// gate (refresh.go:restartPolicyPermitsCellReap) is the only consumer
	// today. Empty/unset is treated as RestartPolicyAlways for
	// back-compat — the pre-#1003 wind-down behavior, where every
	// non-root container exit can trigger a cell-level wind-down.
	RestartPolicy string
	Attachable    bool
	Tty           *ContainerTty
	// CellCgroupPath is the absolute cgroup path of the parent cell (mirrors
	// Cell.Status.CgroupPath). When set, BuildContainerSpec emits an OCI
	// Linux.CgroupsPath rooted at <CellCgroupPath>/<containerd-id> so the
	// container task lands inside the cell's cgroup subtree instead of
	// containerd's runc-shim default placement. Populated by the runner at
	// container-create time; not part of the persisted cell document.
	CellCgroupPath string
	// EtcHostsPath is the host-side path of a kukeond-rendered /etc/hosts file
	// to bind-mount at /etc/hosts inside the container. Empty disables the
	// bind-mount, leaving the image's /etc/hosts in place. Mirrors Docker's
	// per-container hosts pattern; the source file lives under the cell's
	// metadata directory so cell teardown cleans it up. Populated by the
	// runner at container-create time; not part of the persisted document.
	EtcHostsPath string
	// EtcHostnamePath is the host-side path of a kukeond-rendered /etc/hostname
	// file (cell name) to bind-mount at /etc/hostname inside the container.
	// Empty disables the bind-mount. Same lifecycle and storage location as
	// EtcHostsPath; not part of the persisted document.
	EtcHostnamePath string
}

type ContainerState

type ContainerState int
const (
	ContainerStatePending ContainerState = iota
	ContainerStateReady
	ContainerStateStopped
	ContainerStatePaused
	ContainerStatePausing
	ContainerStateFailed
	ContainerStateUnknown
	// ContainerStateNotCreated marks a container with no containerd record at
	// all — distinct from Stopped (a record that exists but whose task is
	// gone). Appended last to keep the ordinals in lockstep with the v1beta1
	// ContainerState enum, which scheme.go converts by direct int cast.
	ContainerStateNotCreated
	// ContainerStateExited is a containerd-stopped task that exited 0 — a
	// clean completion (#1267). Mirrors the cell-level CellStateExited split:
	// ContainerStateStopped no longer conflates a clean exit with a crash.
	// Appended last to keep the ordinals in lockstep with the v1beta1 enum.
	ContainerStateExited
	// ContainerStateError is a containerd-stopped task that exited non-zero —
	// a workload crash (#1267). Distinct from ContainerStateFailed, which
	// stays reserved for kukeon's own container bring-up failures. Appended
	// last (after ContainerStateExited) for the same ordinal-lockstep reason.
	ContainerStateError
)

type ContainerStatus

type ContainerStatus struct {
	Name string // Container name/ID
	ID   string // Container ID (same as Name)
	// CreatedAt is the wall-clock time of the first time the controller
	// observed this container in cell.Spec.Containers. Stamped on the
	// first populateCellContainerStatuses pass and preserved across
	// reconciliations. Sources the AGE column on `kuke get container`.
	CreatedAt    time.Time
	State        ContainerState
	RestartCount int
	RestartTime  time.Time
	StartTime    time.Time
	FinishTime   time.Time
	ExitCode     int
	ExitSignal   string
	// Repos reports the per-repo outcome of kuketty's pre-Serve clone/fetch
	// step. Mirrors the v1beta1 ContainerStatus.Repos payload. Issue #617.
	Repos []RepoStatus
	// Stages reports the per-stage outcome of kuketty's pre-Serve execution of
	// the container's runOn: create stages. Mirrors the v1beta1
	// ContainerStatus.Stages payload; schema only this phase, populated in
	// phase B (#689). Issue #635.
	Stages []StageStatus
}

type ContainerTmpfsMount added in v0.2.0

type ContainerTmpfsMount struct {
	Path      string
	SizeBytes int64
	Options   []string
}

ContainerTmpfsMount declares a tmpfs mount inside the container.

type ContainerTty added in v0.3.0

type ContainerTty struct {
	Prompt   string
	OnInit   []TtyStage
	LogFile  string
	LogLevel string
}

ContainerTty mirrors the v1beta1 ContainerTty payload. See the v1beta1 type for field semantics.

func (*ContainerTty) IsEmpty added in v0.3.0

func (t *ContainerTty) IsEmpty() bool

IsEmpty reports whether the tty block carries no user-supplied config.

type EgressAllowRule added in v0.2.0

type EgressAllowRule struct {
	Host  string
	CIDR  string
	Ports []int
}

EgressAllowRule describes a single permitted destination. Exactly one of Host or CIDR must be set. Empty Ports means "any port on this destination".

type EgressDefault added in v0.2.0

type EgressDefault string

EgressDefault is the fallthrough action when no allowlist rule matches.

const (
	EgressDefaultAllow EgressDefault = "allow"
	EgressDefaultDeny  EgressDefault = "deny"
)

type EgressPolicy added in v0.2.0

type EgressPolicy struct {
	Default EgressDefault
	Allow   []EgressAllowRule
}

EgressPolicy constrains outbound traffic leaving the space bridge. nil means unconstrained; EgressDefaultAllow with no allow rules matches the same unconstrained behavior.

type GitIdentity added in v0.6.0

type GitIdentity struct {
	Name  string
	Email string
}

GitIdentity mirrors the v1beta1 GitIdentity payload.

type Realm

type Realm struct {
	Metadata RealmMetadata
	Spec     RealmSpec
	Status   RealmStatus
}

type RealmMetadata

type RealmMetadata struct {
	Name   string
	Labels map[string]string
	// Generation is a monotonic counter bumped by a writer on each
	// spec-changing update. Defaults to zero; phase 3 (issue #596 follow-up)
	// wires the writers to populate it. See ObservedGeneration on the status.
	Generation int64
}

type RealmSpec

type RealmSpec struct {
	Namespace           string
	RegistryCredentials []RegistryCredentials
}

type RealmState

type RealmState int
const (
	RealmStatePending RealmState = iota
	RealmStateCreating
	RealmStateReady
	RealmStateDeleting
	RealmStateFailed
	RealmStateUnknown
)

type RealmStatus

type RealmStatus struct {
	State      RealmState
	CgroupPath string
	// SubtreeControllers records the cgroup-v2 controllers actually
	// delegated on this realm's own cgroup.subtree_control after the
	// effective filter against the host root's cgroup.controllers (issue
	// #328, surfacing the result of the helper landed by issue #327).
	SubtreeControllers []string
	// CreatedAt is the wall-clock time of the first persist. Stamped
	// only when zero so the value never moves once set (issue #166).
	CreatedAt time.Time
	// UpdatedAt is the wall-clock time of the most recent persist.
	UpdatedAt time.Time
	// ReadyAt is the wall-clock time of the first State==Ready persist.
	// Set-once: never overwritten by subsequent Ready transitions.
	ReadyAt time.Time
	// Reason is a short reason code summarizing why State is in its
	// current value. Empty when no reason has been recorded.
	Reason string
	// Message is the human-readable detail backing Reason.
	Message string
	// CgroupReady reports whether CgroupPath was observed to exist on
	// the host filesystem as of the last status write.
	CgroupReady bool
	// ContainerdNamespaceReady reports whether the realm's containerd
	// namespace was observed to exist as of the last status write.
	ContainerdNamespaceReady bool
	// ObservedGeneration is the Metadata.Generation the reconciler last
	// acted on. Defaults to zero; phase 3 wires the reconciler to compare
	// it against Generation to skip stale work.
	ObservedGeneration int64
}

type RegistryCredentials

type RegistryCredentials struct {
	// Username is the registry username.
	Username string
	// Password is the registry password or token.
	Password string
	// ServerAddress is the registry server address (e.g., "docker.io", "registry.example.com").
	// If empty, credentials apply to the registry extracted from the image reference.
	ServerAddress string
}

RegistryCredentials contains authentication information for a container registry.

type RepoStatus added in v0.6.0

type RepoStatus struct {
	Name   string
	Target string
	State  string
	Commit string
	Error  string
}

RepoStatus mirrors the v1beta1 RepoStatus payload. Issue #617.

type Secret added in v0.6.0

type Secret struct {
	Metadata SecretMetadata
	Spec     SecretSpec
}

Secret is the internal carrier for a named, scoped, daemon-managed credential (kind: Secret, issue #619). It has no Status because a Secret has no runtime: the bytes are written once to a daemon-owned file and the model exists only to ferry the scope coordinates and the material from the apply parser to the storage runner. Spec.Data is never round-tripped back out of the daemon.

type SecretMetadata added in v0.6.0

type SecretMetadata struct {
	Name  string
	Realm string
	Space string
	Stack string
	Cell  string
}

SecretMetadata identifies a Secret by name and the scope it binds to. The scope is the deepest non-empty coordinate; a deeper coordinate requires every shallower one. See the external v1beta1.SecretMetadata for the full contract.

type SecretSpec added in v0.6.0

type SecretSpec struct {
	Data string
}

SecretSpec carries the secret material supplied at apply time.

type Space

type Space struct {
	Metadata SpaceMetadata
	Spec     SpaceSpec
	Status   SpaceStatus
}

type SpaceContainerDefaults added in v0.2.0

type SpaceContainerDefaults struct {
	User                   string
	ReadOnlyRootFilesystem *bool
	Capabilities           *ContainerCapabilities
	SecurityOpts           []string
	Tmpfs                  []ContainerTmpfsMount
	Resources              *ContainerResources
}

SpaceContainerDefaults mirrors the isolation fields on ContainerSpec.

type SpaceDefaults added in v0.2.0

type SpaceDefaults struct {
	Container *SpaceContainerDefaults
}

SpaceDefaults declares default values inherited by resources inside the Space unless the resource's own spec overrides the field. See the external v1beta1.SpaceDefaults type for user-facing documentation.

type SpaceMetadata

type SpaceMetadata struct {
	Name   string
	Labels map[string]string
	// Generation is a monotonic counter bumped by a writer on each
	// spec-changing update. Defaults to zero; phase 3 wires the writers to
	// populate it. See ObservedGeneration on the status.
	Generation int64
}

type SpaceNetwork added in v0.2.0

type SpaceNetwork struct {
	Egress *EgressPolicy
}

SpaceNetwork groups network-scoped policy applied to the space bridge.

type SpaceSpec

type SpaceSpec struct {
	RealmName     string
	CNIConfigPath string
	Network       *SpaceNetwork
	Defaults      *SpaceDefaults
}

type SpaceState

type SpaceState int
const (
	SpaceStatePending SpaceState = iota
	SpaceStateCreating
	SpaceStateReady
	SpaceStateDeleting
	SpaceStateFailed
	SpaceStateUnknown
)

type SpaceStatus

type SpaceStatus struct {
	State      SpaceState
	CgroupPath string
	// SubtreeControllers records the cgroup-v2 controllers actually
	// delegated on this space's own cgroup.subtree_control after the
	// effective filter against the host root's cgroup.controllers (issue
	// #328).
	SubtreeControllers []string
	// Lifecycle and runtime-health fields (issue #166). See
	// RealmStatus for the per-field contract.
	CreatedAt   time.Time
	UpdatedAt   time.Time
	ReadyAt     time.Time
	Reason      string
	Message     string
	CgroupReady bool
	// ObservedGeneration is the Metadata.Generation the reconciler last
	// acted on. Defaults to zero; phase 3 wires the reconciler to compare
	// it against Generation to skip stale work.
	ObservedGeneration int64
}

type Stack

type Stack struct {
	Metadata StackMetadata
	Spec     StackSpec
	Status   StackStatus
}

type StackMetadata

type StackMetadata struct {
	Name   string
	Labels map[string]string
	// Generation is a monotonic counter bumped by a writer on each
	// spec-changing update. Defaults to zero; phase 3 wires the writers to
	// populate it. See ObservedGeneration on the status.
	Generation int64
}

type StackSpec

type StackSpec struct {
	ID        string
	RealmName string
	SpaceName string
}

type StackState

type StackState int
const (
	StackStatePending StackState = iota
	StackStateReady
	StackStateFailed
	StackStateUnknown
)

type StackStatus

type StackStatus struct {
	State      StackState
	CgroupPath string
	// SubtreeControllers records the cgroup-v2 controllers actually
	// delegated on this stack's own cgroup.subtree_control after the
	// effective filter against the host root's cgroup.controllers (issue
	// #328).
	SubtreeControllers []string
	// Lifecycle and runtime-health fields (issue #166). See
	// RealmStatus for the per-field contract.
	CreatedAt   time.Time
	UpdatedAt   time.Time
	ReadyAt     time.Time
	Reason      string
	Message     string
	CgroupReady bool
	// ObservedGeneration is the Metadata.Generation the reconciler last
	// acted on. Defaults to zero; phase 3 wires the reconciler to compare
	// it against Generation to skip stale work.
	ObservedGeneration int64
}

type StageStatus added in v0.6.0

type StageStatus struct {
	Index int
	State string
	Error string
	// Hash is the content hash of the stage at record time — the run-once
	// "done" key. See the v1beta1 type for the merge contract.
	Hash string
}

StageStatus mirrors the v1beta1 StageStatus payload. Phase C1 (#690) adds the Hash key the controller-side merge uses to carry done records across stop/start. Issue #635.

type TtyStage added in v0.3.0

type TtyStage struct {
	Script string
	RunOn  string
}

TtyStage mirrors the v1beta1 TtyStage payload. See the v1beta1 type for field semantics. RunOn is empty/"start" (forward to sbsh's Stages.OnInit) or "create" (kuketty pre-Serve executor). Issue #635.

type VolumeKind added in v0.4.0

type VolumeKind string

VolumeKind discriminates between the supported VolumeMount kinds. An empty value is treated as VolumeKindBind so existing call sites that build a VolumeMount without a Kind keep their bind-mount semantics.

const (
	// VolumeKindBind is a host bind mount. Source and Target are required.
	VolumeKindBind VolumeKind = "bind"
	// VolumeKindTmpfs is an in-memory tmpfs mount. Only Target is required;
	// Source is implicit ("tmpfs"). SizeBytes and Mode tune the standard
	// tmpfs size= and mode= options when non-zero.
	VolumeKindTmpfs VolumeKind = "tmpfs"
)

type VolumeMount added in v0.2.0

type VolumeMount struct {
	Kind     VolumeKind
	Source   string
	Target   string
	ReadOnly bool
	// SizeBytes is the tmpfs size= option in bytes. Only honored when
	// Kind == VolumeKindTmpfs; zero leaves the kernel default.
	SizeBytes int64
	// Mode is the tmpfs mode= option as a 4-digit octal value (e.g. 0755).
	// Only honored when Kind == VolumeKindTmpfs; zero leaves the kernel
	// default (01777).
	Mode uint32
}

VolumeMount is a mount entry attached to a container. The Kind discriminator selects the OCI mount type the runtime emits: bind (host path → container path) or tmpfs (in-memory directory). Empty Kind means bind for back-compat with call sites that predate the discriminator.

Jump to

Keyboard shortcuts

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