File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -413,8 +413,9 @@ func main() {
413413 }()
414414
415415 go func () {
416- err := service .StartInfoEndpoints ()
417- if err != nil {
416+ err := service .StartInfoEndpoints (lis )
417+ // graceful shutdown doesn't quite work with unix domain sockets
418+ if err != nil && ! strings .Contains (err .Error (), "use of closed network connection" ) {
418419 logrus .Fatalf ("Failed to start container inspect endpoint: %v" , err )
419420 }
420421 }()
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package server
33import (
44 "encoding/json"
55 "fmt"
6+ "net"
67 "net/http"
78 "path/filepath"
89
@@ -28,7 +29,7 @@ type CrioInfo struct {
2829
2930// StartInfoEndpoints starts a http server that
3031// serves container information requests and crio daemon information
31- func (s * Server ) StartInfoEndpoints () error {
32+ func (s * Server ) StartInfoEndpoints (l net. Listener ) error {
3233 mux := bone .New ()
3334
3435 mux .Get ("/info" , http .HandlerFunc (func (w http.ResponseWriter , req * http.Request ) {
@@ -76,6 +77,5 @@ func (s *Server) StartInfoEndpoints() error {
7677 w .Write (js )
7778 }))
7879
79- // TODO: Make this configurable
80- return http .ListenAndServe ("localhost:7373" , mux )
80+ return http .Serve (l , mux )
8181}
You can’t perform that action at this time.
0 commit comments