Documentation
¶
Overview ¶
Package readiness computes organisation readiness conditions (design §5.4, contracts.md "Readiness flow"). All functions are pure.
Index ¶
- Constants
- Variables
- func Aggregate(conds []metav1.Condition, gen int64) metav1.Condition
- func Condition(t string, ok bool, reason, msg string, gen int64) metav1.Condition
- func ProbeCurrent(p *v1alpha1.SeatProbeStatus, revision, nonce string) bool
- func SeatConditions(seats []SeatView, enforcement map[string]seatruntime.ProbeResult, gen int64) []metav1.Condition
- func Unknown(t, reason, msg string, gen int64) metav1.Condition
- func VerifyConditions(v *runtimeapi.VerifyResponse, required map[string]bool, gen int64) []metav1.Condition
- type SeatView
Constants ¶
const ( SeatStorageReady = "StorageReady" SeatBackendValid = "BackendValid" SeatHarnessReady = "HarnessReady" // SeatAccessApplied is true when the seat runs the revision its access // profiles need (image tools, NetworkPolicy, proxy, browser). SeatAccessApplied = "AccessApplied" SeatReady = "Ready" )
Seat condition types on AgentSeat.
const ( ProbePending = "pending" ProbePassed = "passed" ProbeFailed = "failed" )
Probe states.
Variables ¶
var Order = []string{ v1alpha1.CondConfigured, v1alpha1.CondIdentitiesReady, v1alpha1.CondStorageReady, v1alpha1.CondHarnessCompatible, v1alpha1.CondSandboxEnforced, v1alpha1.CondConnectionsAuthenticated, v1alpha1.CondIngressReady, v1alpha1.CondBindingsValid, v1alpha1.CondRoutesExecutable, }
Order is the evaluation order of the conditions that OperationalReady requires; the first one that is not True names the blocking reason.
Functions ¶
func Aggregate ¶
Aggregate computes OperationalReady from the other conditions. It is True only when every condition in Order is True for generation gen; otherwise the reason is the first blocking condition type and the message carries that condition's reason and message (which name the seat, binding or connection involved, A02).
func ProbeCurrent ¶
func ProbeCurrent(p *v1alpha1.SeatProbeStatus, revision, nonce string) bool
ProbeCurrent reports whether a seat probe answers the revision and nonce.
func SeatConditions ¶
func SeatConditions(seats []SeatView, enforcement map[string]seatruntime.ProbeResult, gen int64) []metav1.Condition
SeatConditions derives StorageReady, HarnessCompatible, SandboxEnforced and RoutesExecutable from the seats and the per-profile enforcement probes.
func VerifyConditions ¶
func VerifyConditions(v *runtimeapi.VerifyResponse, required map[string]bool, gen int64) []metav1.Condition
VerifyConditions maps a platform verify response to the connection, ingress and binding conditions. Only required connections block readiness.
Types ¶
type SeatView ¶
type SeatView struct {
Key string
SandboxProfile string
ConfigRevision string
// Nonce is the verify nonce the seat probe must answer ("" when none).
Nonce string
Seat *v1alpha1.AgentSeat // nil when not yet created
Ensure error // error while materialising the seat
}
SeatView is what the organisation needs to know about one seat.