Skip to content

Commit

Permalink
register exit handler to dispose ignition socket
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Stocchi <[email protected]>
  • Loading branch information
lstocchi committed Nov 29, 2024
1 parent e659185 commit 101ceb5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/vfkit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ func startIgnitionProvisionerServer(ignitionReader io.Reader, ignitionSocketPath
if err != nil {
return err
}

util.RegisterExitHandler(func() {
os.Remove(ignitionSocketPath)
})

defer func() {
if err := listener.Close(); err != nil {
log.Error(err)
Expand Down

0 comments on commit 101ceb5

Please sign in to comment.