mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
refactor(stacks): use docker-compose-wrapper library (#4979)
This commit is contained in:
parent
592f7024e1
commit
f9ffb1a712
11 changed files with 269 additions and 342 deletions
|
@ -49,13 +49,18 @@ func (factory *ProxyFactory) NewDockerComposeAgentProxy(endpoint *portainer.Endp
|
|||
proxy.Transport = dockercompose.NewAgentTransport(factory.signatureService, httpTransport)
|
||||
|
||||
proxyServer := &ProxyServer{
|
||||
&http.Server{
|
||||
server: &http.Server{
|
||||
Handler: proxy,
|
||||
},
|
||||
0,
|
||||
Port: 0,
|
||||
}
|
||||
|
||||
return proxyServer, proxyServer.start()
|
||||
err = proxyServer.start()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return proxyServer, err
|
||||
}
|
||||
|
||||
func (proxy *ProxyServer) start() error {
|
||||
|
@ -72,7 +77,7 @@ func (proxy *ProxyServer) start() error {
|
|||
err := proxy.server.Serve(listener)
|
||||
log.Printf("Exiting Proxy server %s\n", proxyHost)
|
||||
|
||||
if err != http.ErrServerClosed {
|
||||
if err != nil && err != http.ErrServerClosed {
|
||||
log.Printf("Proxy server %s exited with an error: %s\n", proxyHost, err)
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue