Preflight evaluation and results
Preflight evaluation turns an application release's checks into a result that can guide deployment. The system prepares a release-specific specification, runs the checks against the target cluster, stores progress and results, and exposes the same outcome to the backend, CLI, and browser.
Preflight specification and Helm values
The preflight specification defines the collectors that gather cluster data and the analyzers that turn that data into pass, warning, or fail outcomes. The system prepares this specification from the rendered application release before it gives it to the evaluator.
Preparation keeps checks aligned with the release that will run. It can add checks for private registry images and compare the installed cluster installer with the release installer. When a specification uses Helm templates, the system renders it once for each enabled chart with that chart's values and keeps the chart views separate. The prepared specification is also made available for cluster-side execution through a Kubernetes Secret and a generated command.
The release stores the prepared specification so later result handling can determine whether a strict analyzer failed. A strict analyzer is a check that can block deployment; non-strict checks provide useful warnings without creating the same hard gate.
References: pkg/…/preflight.go• L296-401 pkg/…/preflight.go• L404-503 pkg/…/preflight_helm_values.go• L75-156 pkg/…/preflight_store.go• L174-206
Evaluation lifecycle
The evaluation lifecycle resets old state, prepares the release inputs, runs asynchronously, and records progress before it records the final result. A failed setup or run is represented as a result error so callers can see why evaluation did not complete.
The main application path skips evaluation when configuration is still required or when the release has no checks. Otherwise it marks the release as pending preflight, rewrites collector image data for the current registry, and starts the evaluator. A successful first-version evaluation can hand control to deployment when its result passes the selected policy.
The following flow shows how a release becomes a stored result.
flowchart LR
A[Rendered release] --> B[Prepare specification]
B --> C[Start evaluation]
C --> D[Store progress]
C --> E[Store result]
E --> F[Check strict outcomes]
F --> G[Allow or block deployment]
The upgrade service uses the same evaluator but keeps its progress and result in a short-lived local data file for the upgrade workflow. The Admin Console path stores them with the downstream application version.
References: pkg/…/preflight.go• L47-163 pkg/…/preflight.go• L37-125 pkg/…/preflight.go• L140-190
Result storage
A stored preflight result contains the serialized check report plus release and cluster context. The report can contain a notice, collection errors, and analyzer results; each analyzer result carries its title, message, URI, state, and strictness.
The application store keeps the report, its creation time, progress, and skip state with the downstream version. When a result is saved, active progress is cleared. The store also derives hasFailingStrictPreflights from the saved specification and report so deployment checks do not need to rebuild that decision from raw data.
The result contract has two layers:
| Layer | Purpose |
|---|---|
PreflightResult | Identifies the app and cluster, records time and skip state, and carries the serialized report. |
PreflightResults | Carries the notice, collection errors, and individual analyzer outcomes. |
References: pkg/…/types.go• L9-27 pkg/…/preflight_store.go• L57-72 pkg/…/preflight_store.go• L75-109 pkg/…/preflight_store.go• L142-206
Backend retrieval
The backend exposes one read shape for progress and results so clients can use the same contract while evaluation is running or complete. The response includes preflightProgress and preflightResult; progress is present while the evaluator reports work, and the result is populated when the report is saved.
The Admin Console handlers start or restart evaluation, read the stored result, and accept the result upload from the cluster-side kubectl preflight command. The upload route is unauthenticated because the generated command uses it to return the cluster report. Unsupported Troubleshoot versions are recorded as a notice instead of being treated as normal analyzer output.
The upgrade service has a matching start and read interface. Its handler checks that the request belongs to the active app context, then reads the local upgrade-service data. This lets the browser use one result model even though the two execution paths use different stores.
References: pkg/…/preflight.go• L21-69 pkg/…/preflight.go• L169-234 pkg/…/preflight.go• L236-346 pkg/…/preflight.go• L13-70
CLI result handling
The CLI treats preflight evaluation as an asynchronous gate. It polls the result endpoint until progress is complete and a report is available, then applies the selected skip policy to strict and non-strict outcomes.
The CLI uses these result rules:
- Collection errors stop deployment. RBAC errors use a more specific message because the operator may need to run checks manually or grant access.
- Warnings and failures stop the normal path and return the report to the operator.
- A skip choice ignores non-strict outcomes but still checks strict outcomes.
- A complete report with no blocking outcome allows the install or upgrade path to continue.
When the CLI needs to show the report, PreflightResults prints notices as warnings, collection errors as a list, and analyzer outcomes in a table with state, title, and message. This keeps the terminal view tied to the same report used by deployment decisions.
References: cmd/…/install.go• L995-1060 cmd/…/install.go• L1063-1078 cmd/…/install.go• L1092-1156 pkg/…/preflight.go• L11-35
Browser validation workflow
The browser turns the backend response into a view state for the preflight page. It parses the nested report and progress payloads, polls while evaluation is active, and maps each outcome to display flags such as pass, warning, failure, or strict failure.
The operator sees progress while checks run. After completion, the page shows the report, offers a rerun action, and controls the path to deployment. A strict failure disables deployment. Non-strict warnings or failures can require confirmation before the operator continues. RBAC errors offer a limited-preflight path, while the skip action moves the operator to deployment under the chosen policy.
The upgrade status view also treats temporary API loss as a connection state rather than as a completed upgrade. It keeps checking reachability, resumes upgrade-status polling after recovery, and logs out only when the API confirms that the session is unauthorized. This keeps the operator on the page while the cluster update temporarily makes the API unavailable.
The browser uses this flow for both the initial release path and version history:
sequenceDiagram
participant UI as Preflight page
participant API as Backend API
participant Run as Evaluator
participant Store as Result store
UI->>API: Start or rerun checks
API->>Run: Begin evaluation
UI->>API: Poll result and progress
Run->>Store: Save progress
Run->>Store: Save report
API-->>UI: Result state and outcomes
UI->>UI: Show progress, result, or deployment gate
The shared result hook provides the contract for both browser entry points. The page components then connect that state to rerun, ignore, continue, and deploy controls.
References: web/…/types.ts• L4-75 web/…/usePreflightResults.ts• L5-131 web/…/postPreflightRun.tsx• L3-51 web/…/PreflightResultPage.tsx• L137-267 web/…/PreflightChecks.tsx• L40-185 web/…/UpgradeStatusModal.tsx• L19-49 web/…/UpgradeStatusModal.test.tsx• L27-66
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the serialized result fields aligned across pkg/…/types.go, backend response structs, CLI decoding, and browser response types.
- If the upload URL or generated command changes, update both the rendered specification's
UploadResultsTovalue and the unauthenticated result handler. - If strict-result rules change, check the store's derived blocking flag, CLI skip behavior, and browser deployment state together.
- If progress or empty-result meaning changes, update the polling rules in both the CLI and browser.
- If Helm value or chart selection rules change, verify that the stored specification and the executed specification still describe the same release.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Required configuration is still pending | Evaluation does not start | Complete required configuration before running preflights. |
| Collector image data cannot be rewritten for the selected registry | Evaluation records an error instead of a normal report | Keep registry settings and release image data valid. |
| The result report contains collection or RBAC errors | Deployment is stopped and the operator receives an error path | Review access and collection failures; use the limited-preflight path only when policy permits. |
| A strict analyzer fails or has not produced a valid result | Deployment remains blocked | Fix the reported condition or rerun the checks. |
| The CLI or browser receives malformed nested result JSON | Results cannot be shown or evaluated | Preserve the result serialization contract at the API boundary. |
| The upgrade API returns a temporary server error | The status modal stays in its reconnect state and does not log out the operator | Keep the modal's reachability polling active until the API recovers. |
Key files
| File | Why to read it |
|---|---|
| pkg/…/preflight.go | Shows specification preparation, execution, progress, result storage, and deployment gating. |
| pkg/…/preflight_helm_values.go | Shows the high-level rule for rendering templated checks with chart-specific values. |
| pkg/…/preflight_store.go | Shows the durable result contract and strict-failure derivation. |
| pkg/…/preflight.go | Shows Admin Console start, retrieval, command generation, and cluster upload paths. |
| pkg/…/preflight.go | Shows the upgrade-service evaluation and its local result lifecycle. |
| cmd/…/install.go | Shows CLI polling, policy checks, and deployment decisions. |
| pkg/…/preflight.go | Shows the terminal format for notices, errors, and analyzer outcomes. |
| web/…/usePreflightResults.ts | Shows browser polling and conversion from API data to view state. |
| web/…/PreflightResultPage.tsx | Shows the main result, rerun, ignore, and deploy workflow. |
| web/…/PreflightChecks.tsx | Shows the preflight step inside the upgrade-service flow. |
| web/…/UpgradeStatusModal.tsx | Shows the upgrade status and API reconnection behavior around the browser workflow. |