Documentation
¶
Overview ¶
Package lifecycle holds the controller's seat lifecycle decision (contracts.md "Lifecycle decisions"). Decide is a pure function of the observed seat, backend and platform runtime state and the current time.
Index ¶
Constants ¶
View Source
const ( PolicyWarm = "warm" PolicyWarmThenStop = "warm_then_stop" )
Idle policies.
View Source
const ( ReasonRetired = "Retired" ReasonRetiring = "Retiring" ReasonAdminSuspended = "AdminSuspended" ReasonPendingDeliveries = "PendingDeliveries" ReasonProbe = "SyntheticProbe" ReasonIdle = "IdleTimeout" ReasonConfigChanged = "ConfigRevisionChanged" ReasonFencing = "FencingPreviousExecution" ReasonPodFailed = "PodFailed" ReasonStarting = "Starting" ReasonStopping = "Stopping" ReasonStopped = "Stopped" ReasonRunning = "Running" )
Reasons reported with the execution state.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
// Replicas is the desired replica count (0 or 1).
Replicas int32
// DeletePod names a Pod to delete gracefully (safe-boundary restart).
DeletePod string
// Fence requests POST /internal/v1/seats/{id}/fence with FenceGeneration,
// once FenceHolder has been confirmed gone with a live read.
Fence bool
FenceGeneration int64
FenceHolder string
State v1alpha1.ExecutionState
Reason string
Message string
// RequeueAfter asks for re-evaluation (e.g. at the idle deadline).
RequeueAfter time.Duration
}
Action is the decision.
type Input ¶
type Input struct {
Now time.Time
Retired bool
AdminSuspended bool
// Blocked is a backend validation failure; nil when the seat can run.
Blocked error
IdlePolicy string
IdleTimeout time.Duration
ConfigRevision string
// Backend is the observed backend state (nil before the first ensure).
Backend *seatruntime.Status
// Runtime is the platform's view of the seat (nil when unknown).
Runtime *runtimeapi.SeatRuntime
// ProbePending means a synthetic probe for this revision needs the seat running.
ProbePending bool
}
Input is everything Decide needs.
Click to show internal directories.
Click to hide internal directories.