-
Notifications
You must be signed in to change notification settings - Fork 9
feat(v3): headless install orchestrator implementation - configure application #3170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(v3): headless install orchestrator implementation - configure application #3170
Conversation
|
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer: Airgap Installer (may take a few minutes before the airgap bundle is built): Happy debugging! |
| // It implements the logrus.Hook interface to intercept all log messages and | ||
| // store them for verification in tests. This allows tests to verify that | ||
| // specific log messages are produced without requiring actual log output. | ||
| type logMessageCapture struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems helpful overall, should it be moved to a util package so it can be re-used? maybe in the spinner package even?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will reuse it heavily within this package. if we want to move it to a utility package perhaps we can do that later.
| return orchestrator, nil | ||
| } | ||
|
|
||
| // buildHeadlessInstallOptions (Hop) creates HeadlessInstallOptions from CLI inputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙌
cmd/installer/cli/install_v3_test.go
Outdated
| // Note: This test requires a real API server to be running for authentication. | ||
| // In practice, we would need to mock the API client or have a test server. | ||
| // For now, we'll test the target validation logic which happens before API calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intentional or is the test incomplete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored
cmd/installer/cli/install_v3_test.go
Outdated
| assert.Contains(t, err.Error(), tt.expectedError) | ||
| assert.Nil(t, orchestrator) | ||
| } else { | ||
| // We expect an error here because there's no actual API server running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored
feat(v3): headless install orchestrator implementation - configure application
What this PR does / why we need it
This PR implements the headless installation orchestrator for the v3 API architecture. The orchestrator provides a programmatic way to execute complete installation workflows by coordinating with the v3 API server running in-process.
Key Components
Orchestrator Architecture (
cmd/installer/cli/headless/install/orchestrator.go):Orchestratorinterface for managing headless installation workflowsAPI Client Context Support (
api/client/):context.Contextsupport to all API client methods for better cancellation and timeout handlingCLI Integration (
cmd/installer/cli/install_v3.go):runV3InstallHeadlessfor the new headless installation flowStructured Error Handling (
cmd/installer/cli/headless/install/errors.go):Implementation Status
This PR implements the first phase of the headless installation workflow:
The orchestrator returns an appropriate error indicating the feature is not yet fully implemented. Remaining steps will be added in follow-up PRs.
Testing
Comprehensive test coverage includes:
WithProgressWriter,WithLogger)Code Quality Improvements
Examples
Which issue(s) this PR fixes
[SC-130867]
Does this PR require a test?
Yes - Comprehensive tests included:
cmd/installer/cli/headless/install/errors_test.go- Error formattingcmd/installer/cli/headless/install/orchestrator_test.go- Orchestrator behavior and optionscmd/installer/cli/install_v3_test.go- CLI integration and builder functionsapi/client/client_test.go- Updated for context supportAll tests pass successfully.
Does this PR require a release note?
Does this PR require documentation?
Not at this time - Documentation will be added when the headless installation feature is fully implemented and ready for end-user consumption. Internal API documentation is included in code comments.
Technical Details
API Client Changes
All
api/client.Clientinterface methods now acceptcontext.Contextas the first parameter:This enables:
Orchestrator Pattern
The orchestrator uses the functional options pattern for flexibility:
Error Handling
API errors are structured and user-friendly:
Reset Detection
The orchestrator tracks which failures require a system reset:
This helps users understand recovery steps without trial and error.
Next Steps
Follow-up PRs will implement:
Reviewers
Please pay special attention to: