Merge pull request #4810 from dokku/4804-skip-udp-port
Handle udp ports when fetching network config
This commit is contained in:
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