mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 13:03:41 +00:00
feat: power-cycle
This commit is contained in:
parent
0e5e989192
commit
d0f0530ca2
7 changed files with 242 additions and 18 deletions
|
|
@ -72,6 +72,12 @@ func (d *Daemon) CreateMachine(ctx context.Context, req contracthost.CreateMachi
|
|||
if err := os.Truncate(systemVolumePath, defaultGuestDiskSizeBytes); err != nil {
|
||||
return nil, fmt.Errorf("expand system volume for %q: %w", req.MachineID, err)
|
||||
}
|
||||
if err := injectMachineIdentity(ctx, systemVolumePath, req.MachineID); err != nil {
|
||||
return nil, fmt.Errorf("inject machine identity for %q: %w", req.MachineID, err)
|
||||
}
|
||||
if err := injectGuestConfig(ctx, systemVolumePath, guestConfig); err != nil {
|
||||
return nil, fmt.Errorf("inject guest config for %q: %w", req.MachineID, err)
|
||||
}
|
||||
removeSystemVolumeOnFailure := true
|
||||
defer func() {
|
||||
if !removeSystemVolumeOnFailure {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue