-
Notifications
You must be signed in to change notification settings - Fork 38
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: add mgmt endpoint & cli command for infra machine reboot #826
base: main
Are you sure you want to change the base?
Conversation
Introduce a new mgmt endpoint to reboot an infra machine and wait for the reboot request to be processed by the respective infra provider. It does the heavy lifting of modifying/waiting for the resources. Additionally: - In the `InfraMachineController`, to verify that the machine info was collected before powering it off, check the `TalosVersion` on the `MachineStatus` instead of `SecureBootStatus`. It is a more suitable field to check this. - Rename the infra provider label prefix format from being `omni.sidero.dev/infra-provider[provider-id]/key=value` to be `omni.sidero.dev/infra-provider/provider-id/key=value`. Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
2b76852
to
6866536
Compare
|
||
ctx = actor.MarkContextAsInternalActor(ctx) | ||
|
||
if _, err := safe.StateGetByID[*infra.Machine](ctx, s.omniState, req.MachineId); err != nil { |
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.
Maybe a bit crazy idea, but we could make reboot work seamlessly for all kind of machines.
If the infra machine is not found we can fall back to the talos API call.
What do you think?
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.
Sure, we can do that. I'm just concerned with the fact that this endpoint does not block or report any status (like stream the phases back or something), so not sure how much value it actually brings.
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.
Does it block in case of omnictl power reboot
?
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.
nope, none. It blocks until reboot is issued, not until machine comes back.
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.
so it will be more or less consistent I guess
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.
another crazy idea is to intercept talosctl reboot
command and make it go through the infra provider 🙃
Introduce a new mgmt endpoint to reboot an infra machine and wait for the reboot request to be processed by the respective infra provider. It does the heavy lifting of modifying/waiting for the resources.
Additionally:
InfraMachineController
, to verify that the machine info was collected before powering it off, check theTalosVersion
on theMachineStatus
instead ofSecureBootStatus
. It is a more suitable field to check this.omni.sidero.dev/infra-provider[provider-id]/key=value
to beomni.sidero.dev/infra-provider/provider-id/key=value
.