fix: handle udp ports when fetching network config
When an app only has UDP ports exposed, deploys will fail as we expect there to be a single TCP port. While we _should_ support both, the easier fix is to ignore things and move on. Users can manually expose UDP ports as necessary via the -p flag (or by not specifying the port as a UDP port). One quirk discovered during tests is that disabling zero-downtime deploys results in odd output, but also a deploy can succeed even if one of the processes that skipped zero-downtime fails. We should fix this in another PR, but this is documented in tests for now. Closes #4804
This commit is contained in:
@@ -174,11 +174,14 @@ func GetContainerPort(appName, processType string, containerID string, isHerokui
|
||||
break
|
||||
}
|
||||
}
|
||||
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
|
||||
cmd.Stderr = ioutil.Discard
|
||||
b, err := cmd.Output()
|
||||
if err == nil {
|
||||
port = strings.Split(string(b[:]), ":")[1]
|
||||
|
||||
if port != "" {
|
||||
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
|
||||
cmd.Stderr = ioutil.Discard
|
||||
b, err := cmd.Output()
|
||||
if err == nil {
|
||||
port = strings.Split(string(b[:]), ":")[1]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
port = "5000"
|
||||
|
||||
Reference in New Issue
Block a user