tinkerbell / hook

In-memory Operating System Installation Environment for Executing Tinkerbell Workflows
Apache License 2.0
101 stars 48 forks source link

Adding support for a poweroff watcher #190

Closed jasonyates-thg closed 9 months ago

jasonyates-thg commented 10 months ago

Description

Expands the existing reboot watcher to provide support to power off the host system. Executes /sbin/poweroff once /worker/poweroff is written to disk

Why is this needed

Fixes: (https://github.com/tinkerbell/hook/issues/189)

How Has This Been Tested?

I am unable to build hook locally so this is untested.

How are existing users impacted? What migration steps/scripts do we need?

No impact

jacobweinstock commented 9 months ago

Hey @jasonyates-thg, thanks for this PR. I am hesitant to add this in because we've talked about adding this functionality as a builtin in the tink worker/agent. Also, there is an alternative way to go about it via waitdaemon

chrisdoherty4 commented 9 months ago

I agree with Jacob. I think we have sufficient workarounds and a good plan to provide builtins that'll solve the problem. Our builtins should follow the v1alpha2 API work that's ongoing.