Add systemd validation check to ValidateInstanceImage #24
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.
Add systemd validation check to ValidateInstanceImage
Summary
This PR adds a new validation check to ensure systemd is running on instances, addressing a requirement to validate that systemd is accessible via the
systemctlcommand. The implementation includes:ValidateInstanceImagethat runssystemctl is-system-runningand accepts both "running" and "degraded" states as validconnectToInstance,validateArchitecture,validateOSVersion,validateHomeDirectory,validateSystemd) to fix lint issues with function lengthdocs/SECURITY.mdandREADME.mdto document the new systemd requirementThe systemd check follows the same error handling pattern as existing validation checks and integrates seamlessly with the current validation pipeline.
Review & Testing Checklist for Human
systemctl is-system-runningbehaves correctly on Ubuntu 20.04/22.04 instancesDiagram
%%{ init : { "theme" : "default" }}%% flowchart TD subgraph "pkg/v1/image.go" A["ValidateInstanceImage()"]:::major-edit B["connectToInstance()"]:::major-edit C["validateArchitecture()"]:::major-edit D["validateOSVersion()"]:::major-edit E["validateHomeDirectory()"]:::major-edit F["validateSystemd()"]:::major-edit end subgraph "Documentation" G["docs/SECURITY.md"]:::minor-edit H["README.md"]:::minor-edit end subgraph "Testing Integration" I["internal/validation/suite.go"]:::context end A --> B A --> C A --> D A --> E A --> F I --> A subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#ADD8E6 classDef context fill:#FFFFFFNotes
systemctl is-system-runningwhich can return various states; this implementation accepts "running" and "degraded" as validinternal/validation/suite.gowill automatically include the new systemd check since they callValidateInstanceImagedirectlySession Details: