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:
Jose Diaz-Gonzalez
2021-09-29 00:37:38 -04:00
parent 892391a7fd
commit 82dfcc01e2
2 changed files with 30 additions and 5 deletions

View File

@@ -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"