Make API server datastructure
Added daemon field to it, will use it later for acces to daemon from handlers Signed-off-by: Alexander Morozov <lk4d4@docker.com> Upstream-commit: d9ed3165228b60cb89c31d0d66b99e01ab83eb3e Component: engine
This commit is contained in:
@ -105,12 +105,14 @@ func mainDaemon() {
|
||||
TlsKey: *flKey,
|
||||
}
|
||||
|
||||
api := apiserver.New(serverConfig, eng)
|
||||
|
||||
// The serve API routine never exits unless an error occurs
|
||||
// We need to start it as a goroutine and wait on it so
|
||||
// daemon doesn't exit
|
||||
serveAPIWait := make(chan error)
|
||||
go func() {
|
||||
if err := apiserver.ServeApi(flHosts, serverConfig, eng); err != nil {
|
||||
if err := api.ServeApi(flHosts); err != nil {
|
||||
logrus.Errorf("ServeAPI error: %v", err)
|
||||
serveAPIWait <- err
|
||||
return
|
||||
@ -143,8 +145,8 @@ func mainDaemon() {
|
||||
b.Install()
|
||||
|
||||
// after the daemon is done setting up we can tell the api to start
|
||||
// accepting connections
|
||||
apiserver.AcceptConnections()
|
||||
// accepting connections with specified daemon
|
||||
api.AcceptConnections(d)
|
||||
|
||||
// Daemon is fully initialized and handling API traffic
|
||||
// Wait for serve API job to complete
|
||||
|
||||
Reference in New Issue
Block a user