siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.8k stars 543 forks source link

Extract common tasks as simple function calls #8900

Open smira opened 4 months ago

smira commented 4 months ago

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.

smira commented 4 months ago

To clarify: we can pull them out closer to machined's main() function sequence