typesafehub / conductr-cli

CLI for Lightbend ConductR
Other
16 stars 21 forks source link

Fail if docker run exits with non-zero, thus failing if haproxy fails to start #538

Closed longshorej closed 7 years ago

longshorej commented 7 years ago

Fixes #536 - if starting haproxy in the sandbox fails, an error is raised.

Manual test

Start a process on port 9000, Start the sandbox

$ sandbox run 2.1.4 --no-default-features --feature proxying
|------------------------------------------------|
| Stopping HAProxy                               |
|------------------------------------------------|
sandbox-haproxy
HAProxy has been successfully stopped
|------------------------------------------------|
| Stopping ConductR                              |
|------------------------------------------------|
ConductR core pid 20636 stopped
ConductR agent pid 20753 stopped
ConductR has been successfully stopped
|------------------------------------------------|
| Starting ConductR                              |
|------------------------------------------------|
Bintray credentials loaded from /home/longshorej/.lightbend/commercial.credentials
Extracting ConductR core to /home/longshorej/.conductr/images/core
Extracting ConductR agent to /home/longshorej/.conductr/images/agent
Starting ConductR core instance on 192.168.10.1..
Waiting for ConductR to start.
Starting ConductR agent instance on 192.168.10.1..
|------------------------------------------------|
| Starting HAProxy                               |
|------------------------------------------------|
Exposing the following ports [80, 443, 3000, 5601, 8999, 9000, 9200, 9999]
06e9195c304a506de7b53f27be2c3e3bb168725e3552ba18ba3dc907d2b8cc0e
docker: Error response from daemon: driver failed programming external connectivity on endpoint sandbox-haproxy (776a303db2ee86a86c259788f79bb2acdddd096f9d9b50be7a7d19f3895135a2): Error starting userland proxy: listen tcp 192.168.10.1:9000: bind: address already in use.
Error: Encountered unexpected error.
Error: Reason: AssertionError docker exited with 125
Error: Further information of the error can be found in the error log file: /home/longshorej/.conductr/errors.log
-> 1