Documentation
¶
Overview ¶
Package execution defines portable demands and actual executor allocations. It has no scheduler dependencies and never treats a request as an allocation.
Index ¶
Constants ¶
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocation ¶
type Allocation struct {
SchemaVersion int `json:"schema_version"`
Image Image `json:"image,omitempty"`
Platform *string `json:"platform,omitempty"`
Resources Resources `json:"resources,omitempty"`
}
Allocation contains simultaneous usable capacities reported by the trusted provisioner, not requested limits or capacities discovered from the host.
func (Allocation) HasCompatibilityFacts ¶
func (a Allocation) HasCompatibilityFacts() bool
HasCompatibilityFacts excludes image IDs, which are diagnostic only.
func (Allocation) Normalize ¶
func (a Allocation) Normalize() (Allocation, error)
type Mismatch ¶
type Mismatch struct {
Field string `json:"field"`
Required string `json:"required"`
Allocated string `json:"allocated,omitempty"`
Reason string `json:"reason"`
}
func Compare ¶
func Compare(required Requirements, allocated Allocation) ([]Mismatch, error)
Compare validates both operands. A nil error with no mismatches proves compatibility only with this supplied allocation, never lease readiness.
type Requirements ¶
type Requirements struct {
Image *string `json:"image,omitempty" yaml:"image,omitempty"`
Platform *string `json:"platform,omitempty" yaml:"platform,omitempty"`
Resources Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
}
Requirements is also the partial override format: nil preserves the base property. Explicit empty values are invalid; version 1 does not support clear.
func Overlay ¶
func Overlay(base, override Requirements) Requirements
Overlay returns an independent copy; callers cannot mutate either input via the returned pointers. Validate patches before overlaying them.
func (Requirements) Empty ¶
func (r Requirements) Empty() bool
func (Requirements) Normalize ¶
func (r Requirements) Normalize() (Requirements, error)
Normalize validates all supplied fields and returns canonical values.