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:
1 parent
892391a7fd
commit
82dfcc01e2
2 files changed
+30
-5
No files matched your search
@@ -174,11 +174,14 @@ func GetContainerPort(appName, processType string, containerID string, isHerokui
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
|
|
||||||
cmd.Stderr = ioutil.Discard
|
if port != "" {
|
||||||
b, err := cmd.Output()
|
cmd := sh.Command(common.DockerBin(), "container", "port", containerID, port)
|
||||||
if err == nil {
|
cmd.Stderr = ioutil.Discard
|
||||||
port = strings.Split(string(b[:]), ":")[1]
|
b, err := cmd.Output()
|
||||||
|
if err == nil {
|
||||||
|
port = strings.Split(string(b[:]), ":")[1]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
port = "5000"
|
port = "5000"
|
||||||
|
|||||||
@@ -241,3 +241,25 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(network) handle single-udp app" {
|
||||||
|
run /bin/bash -c "dokku docker-options:add $TEST_APP -p 1194:1194"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku checks:disable $TEST_APP"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
# The app _should_ fail to deploy because it requires some config file
|
||||||
|
# but we really only care about getting to pre-flight checks so that is fine.
|
||||||
|
# It does not because of some yet unknown bug in deploying when zero-downtime is disable...
|
||||||
|
run /bin/bash -c "dokku git:from-image $TEST_APP kylemanna/openvpn:latest"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
assert_output_contains "Attempting pre-flight checks" 0
|
||||||
|
assert_output_contains "Application deployed"
|
||||||
|
}
|
||||||
Reference in new issue
Block a user