Here we execute a sequence of steps (a bit different for containers/non-containers), which might look better as a simple sequence of Go function calls with defer steps to undo the action, as they should be called strictly before anything else starts running, and undone before the machine shuts down operations.
Code in question: https://github.com/siderolabs/talos/blob/1fb8453c2db1659dd6c1670e4174125b26e777c5/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go#L89-L103
Here we execute a sequence of steps (a bit different for containers/non-containers), which might look better as a simple sequence of Go function calls with
defer
steps to undo the action, as they should be called strictly before anything else starts running, and undone before the machine shuts down operations.