Documentation
¶
Overview ¶
Package firecrackerbootprobelease owns the private persisted lease guard for one sealed Firecracker boot probe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidState identifies a malformed or non-canonical persisted boot-probe lease state. ErrInvalidState = errors.New("invalid Firecracker boot-probe lease state") // ErrRenewalRefused identifies a stale, forked, mismatched, or non-successive authenticated renewal. ErrRenewalRefused = errors.New("Firecracker boot-probe renewal refused") // ErrLeaseExpired identifies an expired lease that must remain cleanup-pending. ErrLeaseExpired = errors.New("Firecracker boot-probe lease expired") // ErrProbeAlreadyStarted identifies a duplicate probe-start transition. ErrProbeAlreadyStarted = errors.New("Firecracker boot probe already started") )
Functions ¶
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard serializes transitions for one recovered or newly sealed State. Persist callers store Snapshot with their own expected-version/CAS boundary; Guard prevents in-process renewal forks.
func NewGuard ¶
NewGuard seals an already-authenticated initial grant into an active private lease state.
func (*Guard) AdvanceTime ¶
AdvanceTime records expiry as cleanup-pending. It never infers cleanup and never revives an expired lease.
func (*Guard) RecordProbeStarted ¶
RecordProbeStarted records one durable probe-start intent without launching a Jailer, VMM, guest, or PING.
func (*Guard) RenewAuthenticated ¶
func (guard *Guard) RenewAuthenticated(renewal firecrackerlaunchgrant.Grant, now time.Time) (State, error)
RenewAuthenticated accepts exactly the next already-authenticated renewal for this Guard. Callers authenticate the M3 envelope and derive the trusted M4 identity before passing renewal here. A renewal changes only Current and RenewalCount; it cannot create a new probe-start authorization.
type Phase ¶
type Phase string
Phase is the durable lifecycle phase of a private boot-probe lease.
const ( // PhaseActive means the current grant is not yet expired and may be renewed or recorded as started. PhaseActive Phase = "active" // PhaseExpiredCleanupPending means expiry was observed and no later transition may revive or launch the probe. PhaseExpiredCleanupPending Phase = "expired-cleanup-pending" )
type State ¶
type State struct {
Version string `json:"version"`
Initial firecrackerlaunchgrant.Grant `json:"initial"`
Current firecrackerlaunchgrant.Grant `json:"current"`
Phase Phase `json:"phase"`
Probe Probe `json:"probe"`
ProbeStartedAt time.Time `json:"probe_started_at,omitempty"`
CleanupPendingAt time.Time `json:"cleanup_pending_at,omitempty"`
RenewalCount uint64 `json:"renewal_count"`
}
State is the serializable, redacted snapshot for one sealed private boot-probe lease. Initial never changes. Current advances only through the next exact authenticated delivery tuple and fence. The state includes no control signature, raw request, credential, host path, or guest output.
func (State) CleanupPending ¶
CleanupPending reports whether expiry has been durably surfaced for operator-owned cleanup.