Skip to content

Commit 1c4f9af

Browse files
committed
feat: implement infra machine reboot
Implement reboot functionality. The logic goes as follows: - When a user wants to reboot a server, they set a new unique `requested_reboot_id` on the `InfraMachineConfig` resource (for example, a UUID). - When the `InfraMachineStatus` resource gets updated with the `last_reboot_id` equal to the requested one, Omni knows that the reboot was processed. - The `last_reboot_timestamp` is updated by the infra provider when a machine is actually rebooted. The provider might or might not issue a reboot for each and every reboot request - if it had rebooted the machine too recently - but it will mark the request as "processed" by updating the `last_reboot_id`. Signed-off-by: Utku Ozdemir <[email protected]>
1 parent edc47a0 commit 1c4f9af

File tree

9 files changed

+364
-105
lines changed

9 files changed

+364
-105
lines changed

client/api/omni/specs/infra.pb.go

Lines changed: 138 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/specs/infra.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package specs;
44
option go_package = "github.com/siderolabs/omni/client/api/omni/specs";
55

66
import "omni/specs/omni.proto";
7+
import "google/protobuf/timestamp.proto";
78

89
message MachineRequestSpec {
910
string talos_version = 1;
@@ -46,6 +47,8 @@ message InfraMachineSpec {
4647
string wipe_id = 5;
4748

4849
string extra_kernel_args = 6;
50+
51+
string requested_reboot_id = 7;
4952
}
5053

5154
message InfraMachineStateSpec {
@@ -61,6 +64,8 @@ message InfraMachineStatusSpec {
6164

6265
MachinePowerState power_state = 1;
6366
bool ready_to_use = 2;
67+
string last_reboot_id = 3;
68+
google.protobuf.Timestamp last_reboot_timestamp = 4;
6469
}
6570

6671
message InfraProviderStatusSpec {

client/api/omni/specs/infra_vtproto.pb.go

Lines changed: 150 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/specs/omni.pb.go

Lines changed: 16 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/api/omni/specs/omni.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,4 +1284,5 @@ message InfraMachineConfigSpec {
12841284
MachinePowerState power_state = 1;
12851285
AcceptanceStatus acceptance_status = 2;
12861286
string extra_kernel_args = 3;
1287+
string requested_reboot_id = 4;
12871288
}

client/api/omni/specs/omni_vtproto.pb.go

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)