Documentation
¶
Index ¶
- func DetectMachineRoot() bool
- func EnsureAgentSubtree(policy *CgroupPolicy) error
- func IsMachineRootCgroupPath(unifiedPath string) bool
- func MapRuntimeError(err error, policy *CgroupPolicy) error
- func NeedsEdgeletCgroupParentPrep(policy *CgroupPolicy) bool
- func SetGlobalPolicy(p *CgroupPolicy)
- func ValidatePreflight(policy *CgroupPolicy) error
- func ValidatePreflightLight(policy *CgroupPolicy) error
- type CgroupPolicy
- type Driver
- type ErrDelegation
- type Mode
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectMachineRoot ¶
func DetectMachineRoot() bool
DetectMachineRoot reports LXC/VM machine-root hosts (e.g. OrbStack /.lxc layout).
func EnsureAgentSubtree ¶
func EnsureAgentSubtree(policy *CgroupPolicy) error
EnsureAgentSubtree creates the agent cgroup and moves the current process into it.
func IsMachineRootCgroupPath ¶
IsMachineRootCgroupPath reports VM/LXC machine boundary cgroups (not workload containers).
func MapRuntimeError ¶
func MapRuntimeError(err error, policy *CgroupPolicy) error
MapRuntimeError converts common CRI/crun delegation failures into actionable errors.
func NeedsEdgeletCgroupParentPrep ¶
func NeedsEdgeletCgroupParentPrep(policy *CgroupPolicy) bool
NeedsEdgeletCgroupParentPrep reports whether /edgelet must be prepared before agent subtrees.
func SetGlobalPolicy ¶
func SetGlobalPolicy(p *CgroupPolicy)
SetGlobalPolicy records the active policy after bootstrap.
func ValidatePreflight ¶
func ValidatePreflight(policy *CgroupPolicy) error
ValidatePreflight checks delegation requirements after bootstrap prep (fat runtime).
func ValidatePreflightLight ¶
func ValidatePreflightLight(policy *CgroupPolicy) error
ValidatePreflightLight checks cgroup detectability for init start_pre hooks (no mutation).
Types ¶
type CgroupPolicy ¶
type CgroupPolicy struct {
Mode Mode
Driver Driver
Nested bool
MachineRoot bool
SystemdCgroup bool
UnifiedMountpoint string
AgentCgroupPath string
ContainerdCgroupPath string
DelegatedControllers []string
HybridWarning string
}
CgroupPolicy is the resolved cgroup bootstrap policy for embedded edgelet.
func Bootstrap ¶
func Bootstrap() (*CgroupPolicy, error)
Bootstrap detects policy, ensures the agent subtree, and stores it globally.
func Detect ¶
func Detect() (*CgroupPolicy, error)
Detect inspects the host and returns a recommended cgroup policy.
func GetGlobalPolicy ¶
func GetGlobalPolicy() *CgroupPolicy
GetGlobalPolicy returns the active policy, if bootstrap completed.
func PublishHostPolicy ¶
func PublishHostPolicy() (*CgroupPolicy, error)
PublishHostPolicy runs Detect() and stores the result for status reporting without mutating the cgroup hierarchy. Used by the control plane when EDGELET_RUNTIME_SPLIT=1; bootstrap remains owned by runtime-bootstrap.
type ErrDelegation ¶
type ErrDelegation struct {
Controller string
Nested bool // workload container (docker/k8s dev image)
MachineRoot bool // LXC/VM machine root without delegation
Mode Mode
}
ErrDelegation indicates required cgroup controllers are not delegated to edgelet.
func (*ErrDelegation) Error ¶
func (e *ErrDelegation) Error() string
type Snapshot ¶
type Snapshot struct {
Mode string
Driver string
Nested bool
DelegatedControllers string
AgentCgroupPath string
ContainerdCgroupPath string
}
Snapshot exposes cgroup diagnostics for status reporting.
func GetSnapshot ¶
func GetSnapshot() Snapshot
GetSnapshot returns diagnostics for the active policy.
func SnapshotFromPolicy ¶
func SnapshotFromPolicy(p *CgroupPolicy) Snapshot
SnapshotFromPolicy builds a status snapshot from policy.