fix potential panic on http server close (#496)
This commit is contained in:
@@ -108,13 +108,11 @@ This allows users to schedule kubernetes workloads on nodes that aren't running
|
||||
rootContextCancel()
|
||||
}()
|
||||
|
||||
c1, c2, err := setupHTTPServer(rootContext, apiConfig)
|
||||
cancelHTTP, err := setupHTTPServer(rootContext, apiConfig)
|
||||
if err != nil {
|
||||
log.G(rootContext).Fatal(err)
|
||||
}
|
||||
|
||||
defer c1.Close()
|
||||
defer c2.Close()
|
||||
defer cancelHTTP()
|
||||
|
||||
if err := vk.Run(rootContext); err != nil && errors.Cause(err) != context.Canceled {
|
||||
log.G(rootContext).Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user