chore(v3): headless install dryrun tests #3194
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a critical bug where preflight execution failures incorrectly reported as successful in headless installs, adds comprehensive test coverage, and refactors preflight result handling for consistency across the codebase.
Bug Fix
Problem: The headless orchestrator (
cmd/installer/cli/headless/install/orchestrator.go) only checkedresp.Outputfor failures. When preflights failed to execute (nil output), it incorrectly reported "Host preflights passed" and continued installation.Impact: Headless installs would proceed on incompatible systems when preflights failed to run due to infrastructure issues, permissions, or runtime errors.
Fix: Now checks
resp.Status.Statefirst. WhenStateFailed:Applied to both host and app preflights in the orchestrator and API controllers.
Changes
Preflight State Handling Refactor
Status.Statebefore examining outputgetStateFromAppPreflightsOutput,getStateFromPreflightsOutput) to use the same patternDependency Injection
PreflightRunnerInterfacethroughout the codebase (API, controllers, handlers, managers)Test Coverage
Testing
Integration Tests (
tests/dryrun/v3_install_test.go)Unit Tests
cmd/installer/cli/headless/install/orchestrator_test.goapi/controllers/app/apppreflight_test.go,api/controllers/linux/install/hostpreflight_test.goRelated
Part of SC-130867 (headless install orchestrator implementation).