Documentation
¶
Overview ¶
Package node implements the language-independent node execution contract.
Index ¶
- Constants
- func AcquireCacheGuard(ctx context.Context, root string, exclusive bool) (io.Closer, error)
- func CheckFileCapabilities(path string) error
- func CheckProcess(p *specs.Process) error
- func InRoot(root, name string) (string, error)
- func MergeProcess(p *specs.Process, m Metadata) error
- func RewriteExec(p *specs.Process, state InitialState) error
- func ValidateFilesystem(spec *specs.Spec, metadata Metadata, root string) error
- func ValidateID(id string) error
- func ValidateMountDestinations(destinations []string) error
- func ValidateRoot(root string, m *Metadata) error
- func ValidateVolumeMountPaths(paths []string) error
- func ValidateWorkloadMount(destination string, readOnly bool, allowed []string) error
- type ApplicationIdentity
- type Authorization
- type Barrier
- type BindingObservation
- type Error
- type Evidence
- type EvidenceRequest
- type EvidenceResponse
- type InitialState
- type Lease
- type LinuxEvidence
- type Metadata
- type MountEvidence
- type RevocationReceipt
- type RuntimeBinding
- type Store
- func (s *Store) AcquireTaskGuard(ctx context.Context, task string) (io.Closer, error)
- func (s *Store) AcquireWriter(ctx context.Context) (io.Closer, error)
- func (s *Store) Authorizations() ([]Authorization, error)
- func (s *Store) Check() error
- func (s *Store) Collect(ctx context.Context, id string, grace time.Duration, evidence Evidence, ...) error
- func (s *Store) Current(ctx context.Context, id string) (Metadata, string, error)
- func (s *Store) IdleUninstall(ctx context.Context, id string, ttl time.Duration, evidence Evidence, ...) (bool, error)
- func (s *Store) Initialize() error
- func (s *Store) Leases() ([]Lease, error)
- func (s *Store) LoadInitial(task string) (InitialState, error)
- func (s *Store) Publish(ctx context.Context, staging string, m Metadata, ...) error
- func (s *Store) Recover(ctx context.Context, evidence Evidence) error
- func (s *Store) Release(ctx context.Context, task string, evidence Evidence) error
- func (s *Store) RemoveRequest(id string) error
- func (s *Store) Requests() ([]string, error)
- func (s *Store) Resolve(ctx context.Context, id, namespace, task string, barrier *Barrier, ...) (Lease, string, error)
- func (s *Store) ResolveTask(ctx context.Context, id, namespace, task string, barrier *Barrier, ...) (Lease, string, error)
- func (s *Store) Retire(ctx context.Context, id, profile string, evidence Evidence, ...) error
- func (s *Store) RetireRevoked(ctx context.Context, id, profile string, evidence Evidence, ...) error
- func (s *Store) Revoke(ctx context.Context, id, profile string) error
- func (s *Store) SaveInitial(state InitialState) error
- func (s *Store) ValidateLease(ctx context.Context, l Lease) error
- func (s *Store) WriteAuthorization(ctx context.Context, a Authorization) error
- type TaskMounts
Constants ¶
const BindingsAnnotation = "brewlet.sh/runtime-bindings"
const RevocationsAnnotation = "brewlet.sh/runtime-revocations"
Variables ¶
This section is empty.
Functions ¶
func AcquireCacheGuard ¶
func CheckFileCapabilities ¶
func CheckProcess ¶
func MergeProcess ¶
MergeProcess preserves CRI argv/cwd and applies only the runtime environment precedence, synthesized HOME, and mandatory non-root restrictions.
func RewriteExec ¶
func RewriteExec(p *specs.Process, state InitialState) error
RewriteExec deliberately ignores CRI's independently synthesized environment and credentials; the durable initial state is the execution authority.
func ValidateFilesystem ¶
func ValidateID ¶
func ValidateRoot ¶
func ValidateVolumeMountPaths ¶
Mount locations are administrator-owned data/configuration zones, not runtime discovery. Keeping them immutable within an inventory epoch binds the policy to every installed generation and lease.
Types ¶
type ApplicationIdentity ¶
type ApplicationIdentity struct {
Reference string `json:"reference"`
RootDigest string `json:"rootDigest"`
ManifestDigest string `json:"manifestDigest"`
ConfigDigest string `json:"configDigest"`
Platform ocispec.Platform `json:"platform"`
}
func (ApplicationIdentity) Validate ¶
func (a ApplicationIdentity) Validate() error
type Authorization ¶
type Authorization struct {
ID string `json:"id"`
InventoryUID string `json:"inventoryUID"`
Generation int64 `json:"generation"`
Digest string `json:"digest"`
ProfileUID string `json:"profileUID"`
ProfileGeneration int64 `json:"profileGeneration"`
ExpiresAt time.Time `json:"expiresAt"`
Revoked bool `json:"revoked"`
Install string `json:"install"`
State string `json:"state"`
}
type Barrier ¶
type Barrier struct {
ID string `json:"id"`
InventoryUID string `json:"inventoryUID"`
Generation int64 `json:"generation"`
}
func ParseBarrier ¶
type BindingObservation ¶
type Evidence ¶
Evidence must establish absence of tasks, execs AND mounts, including other mount namespaces. An error or incomplete evidence always retains the lease.
type EvidenceRequest ¶
type EvidenceResponse ¶
type InitialState ¶
type LinuxEvidence ¶
LinuxEvidence requires a complete host procfs. Containerized hosts are not silently treated as initial host PID/user namespaces.
func (LinuxEvidence) MountsGone ¶
func (LinuxEvidence) RuntimeGone ¶
func (e LinuxEvidence) RuntimeGone(ctx context.Context) (bool, error)
type Metadata ¶
type Metadata struct {
ID string `json:"id"`
InventoryUID string `json:"inventoryUID"`
Generation int64 `json:"generation"`
SourceDigest string `json:"sourceDigest"`
ManifestDigest string `json:"manifestDigest"`
Platform ocispec.Platform `json:"platform"`
Env []string `json:"env"`
UID uint32 `json:"uid"`
GID uint32 `json:"gid"`
VolumeMountPaths []string `json:"volumeMountPaths,omitempty"`
Home string `json:"home"`
Homes map[uint32]string `json:"homes"`
ValidatedAt time.Time `json:"validatedAt"`
}
type MountEvidence ¶
type RevocationReceipt ¶
type RevocationReceipt struct {
InventoryUID string `json:"inventoryUID"`
Generation int64 `json:"generation"`
Digest string `json:"digest"`
ProfileUID string `json:"profileUID"`
ProfileGeneration int64 `json:"profileGeneration"`
NodeUID string `json:"nodeUID"`
RevokedAt time.Time `json:"revokedAt"`
AuthorizationExpiresAt time.Time `json:"authorizationExpiresAt"`
RootsCleaned bool `json:"rootsCleaned"`
}
type RuntimeBinding ¶
type RuntimeBinding struct {
Application *ApplicationIdentity `json:"application,omitempty"`
ContainerID string `json:"containerID"`
ContainerdNamespace string `json:"containerdNamespace"`
PodUID string `json:"podUID"`
PodName string `json:"podName"`
PodNamespace string `json:"podNamespace"`
ContainerName string `json:"containerName"`
ID string `json:"id"`
InventoryUID string `json:"inventoryUID"`
Generation int64 `json:"generation"`
Digest string `json:"digest"`
State string `json:"state"`
}
type Store ¶
type Store struct {
Root string
// contains filtered or unexported fields
}
func (*Store) AcquireTaskGuard ¶
AcquireTaskGuard excludes recovery while Create can still publish mounts or delegate a task. The lock is outside .tasks so removing a lease cannot split it. Fixed stripes bound persistent lock files; a collision only delays a caller.
func (*Store) Authorizations ¶
func (s *Store) Authorizations() ([]Authorization, error)
func (*Store) Collect ¶
func (s *Store) Collect(ctx context.Context, id string, grace time.Duration, evidence Evidence, fence func(context.Context) error) error
Collect is deliberately conservative: every durable lease survives restart, and complete cross-namespace task/mount evidence is mandatory even when the lease directory is empty. Unknown or malformed records prevent deletion.
func (*Store) Current ¶
Current reads installed metadata without acquiring a task lease. It is used only by the fenced provisioner, not as an alternate Create authority.
func (*Store) IdleUninstall ¶
func (*Store) Initialize ¶
func (*Store) LoadInitial ¶
func (s *Store) LoadInitial(task string) (InitialState, error)
func (*Store) Publish ¶
func (s *Store) Publish(ctx context.Context, staging string, m Metadata, fence func(context.Context) error) error
Publish installs an already extracted, validated staging directory containing rootfs. The caller must hold the exclusive provisioner writer lock and must perform its fresh cluster fence immediately before this call.
func (*Store) Recover ¶
Recover reconciles durable leases rather than resetting reference counts at shim/provisioner restart. Uncertainty is an error, never permission to collect.
func (*Store) RemoveRequest ¶
func (*Store) Resolve ¶
func (s *Store) Resolve(ctx context.Context, id, namespace, task string, barrier *Barrier, wait time.Duration) (Lease, string, error)
Resolve leases current under the same cross-process lock as publication and collection. Only an uninstalled OnDemand entry creates an empty request.
func (*Store) ResolveTask ¶
func (*Store) Retire ¶
func (s *Store) Retire(ctx context.Context, id, profile string, evidence Evidence, fence func(context.Context) error) error
Retire removes only this profile's revoked inventory, and only after complete task/exec/mount evidence. It never treats an absent current pointer as proof that the runtime has no consumers.
func (*Store) RetireRevoked ¶
func (s *Store) RetireRevoked(ctx context.Context, id, profile string, evidence Evidence, fence func(context.Context) error) error
RetireRevoked keeps the authorization tombstone so new starts still report RuntimeImageRevoked after the approved resource's roots have drained.
func (*Store) SaveInitial ¶
func (s *Store) SaveInitial(state InitialState) error
func (*Store) WriteAuthorization ¶
func (s *Store) WriteAuthorization(ctx context.Context, a Authorization) error
type TaskMounts ¶
type TaskMounts struct {
Bundle string `json:"bundle"`
Upper string `json:"upper"`
Work string `json:"work"`
}
TaskMounts records protected containerd mount provenance before a lease can outlive Create. Shared runtime/cache lowers cannot identify a particular task.
func (TaskMounts) Validate ¶
func (m TaskMounts) Validate(namespace, task string) error