crc-org / vfkit

Apache License 2.0
144 stars 27 forks source link

Allow to register exit handlers #229

Open lstocchi opened 1 day ago

lstocchi commented 1 day ago

In the current code base we already handle the interrupt signals in the virtionet.go file. However we could need to listen to them in other parts of the code (e.g in the ignition part to delete the socket created)

https://github.com/crc-org/vfkit/blob/9adfb530e670eb9cb21e057e9e5e5054b36a1e92/pkg/vf/virtionet.go#L177

We should centralize it so that it is possible to register multiple exit handlers that will be executed in one place.

cfergeau commented 1 day ago

Yup, would be useful to generalize this. Iirc there are several go modules doing this, each with their own caveats ;)