Skip to content

Commit

Permalink
feat: implement powering machines on/off
Browse files Browse the repository at this point in the history
Power on/off machines based on the preferred power state and their pending operations.

Signed-off-by: Utku Ozdemir <[email protected]>
  • Loading branch information
utkuozdemir committed Dec 11, 2024
1 parent 4f52230 commit 084104c
Show file tree
Hide file tree
Showing 13 changed files with 490 additions and 61 deletions.
121 changes: 87 additions & 34 deletions api/specs/specs.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/specs/specs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ message MachineStatusSpec {
// It is used to track the last reboot time of the machine, and to enforce the MinRebootInterval.
google.protobuf.Timestamp last_reboot_timestamp = 5;
}

message PowerStatusSpec {
PowerState power_state = 1;
}
157 changes: 157 additions & 0 deletions api/specs/specs_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/provider/baremetal/machine_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewMachineStatus(id string) *MachineStatus {
// MachineStatusType is the type of MachineStatus resource.
var MachineStatusType = infra.ResourceType("BareMetalMachineStatus", providermeta.ProviderID)

// MachineStatus describes machineStatus configuration.
// MachineStatus describes machine status configuration.
type MachineStatus = typed.Resource[MachineStatusSpec, MachineStatusExtension]

// MachineStatusSpec wraps specs.MachineStatusSpec.
Expand Down
Loading

0 comments on commit 084104c

Please sign in to comment.