mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 04:16:21 +02:00
fix: remove listening socket to fix Talos in a container restart
Fixes #4462 As `/system` volumes survives restarts in a container mode, we need to make sure listening file socket is removed before creating a listener. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
parent
53bbb13ed8
commit
f6110f8036
@ -72,6 +72,11 @@ func (o *APID) PreFunc(ctx context.Context, r runtime.Runtime) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// clean up the socket if it already exists (important for Talos in a container)
|
||||
if err := os.RemoveAll(constants.APIRuntimeSocketPath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
listener, err := net.Listen("unix", constants.APIRuntimeSocketPath)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user