Skip to content

Commit 76af1b1

Browse files
authored
Merge pull request #3939 from norio-nomura/close-hostagent-server
`hostagent`: Fix: `ha.sock` was not removed on exit
2 parents 753bf0a + 901dc27 commit 76af1b1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmd/limactl/hostagent.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,11 @@ func hostagentAction(cmd *cobra.Command, args []string) error {
125125
return err
126126
}
127127
go func() {
128-
defer os.RemoveAll(socket)
129-
defer srv.Close()
130128
if serveErr := srv.Serve(l); serveErr != http.ErrServerClosed {
131129
logrus.WithError(serveErr).Warn("hostagent API server exited with an error")
132130
}
133131
}()
132+
defer srv.Close()
134133
return ha.Run(cmd.Context())
135134
}
136135

0 commit comments

Comments
 (0)