Skip to content

Concept

Phases and conditions

Each object has conditions. A condition is one fact with a status, a reason and a message. The phase is one word that summarizes the conditions. Read the conditions to know why something waits.

Controllers write conditions. One package derives the phase and blockedOn from the conditions. People and tables read the phase.ControllersobserveConditionsthe factsinternal/phasederivephase, blockedOnfor peoplewritereadstamp
One direction only: the controllers never read the phase.
Condition
A fact with a type (for example Verified), a status (True, False or Unknown), a reason and a message in plain words.
Reason
One CamelCase word that a script can compare, for example SerialMismatch.
Phase
A summary of the conditions. The package internal/phase derives it again on each pass. It has no memory of the previous phase.
blockedOn
The reason of the condition that holds the object now. pk-metal status shows it in the BLOCKED column.
  1. A controller decides only on conditions. It never reads a phase.
  2. Only the stamp functions in internal/phase write phase and blockedOn. A test fails on any other write.
  3. The derivation is a list in order of precedence. Hard stops come first, for example Unreachable and Mismatch.
Host phases. A Host moves from Enrolling to Provisioned. A release takes it back to Available. Failed and Maintenance are stops.EnrollingInspectingAvailableAssignedProvisioningProvisionedReachableVerifiedclaimBootedOSReadyFailedReleasingMaintenanceany phase, by annotationFalseclaim deletedwiped, free again
Host phases. The phase is a summary of the conditions.
Kind Phases
ManagementEndpoint Pending, Connecting, Inventorying, Verifying, Configuring, Ready, Unreachable, Mismatch
Host Enrolling, Inspecting, Available, Assigned, Provisioning, Provisioned, Releasing, Failed, Maintenance
HostClaim Pending, Bound, Ambiguous
HostOperation Proposed, AwaitingApproval, Running, Succeeded, Failed, Aborted