Merge pull request #9011 from visheshgubrani/scheduler-k3s-run-exit-code

Propagate command exit code on dokku run
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2026-09-18 04:08:45 -04:00
commit 55ffe6809b
6 files changed
+306 -34

No files matched your search

+17
View File
@@ -178,6 +178,23 @@ teardown() {
[[ "$output" != *"uid="* ]] || flunk "id command output leaked - env value was expanded"
}
@test "(run) run propagates the command exit code" {
run deploy_app dockerfile
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku run $TEST_APP sh -c 'exit 3'"
echo "output: $output"
echo "status: $status"
assert_exit_status 3
run /bin/bash -c "dokku run $TEST_APP sh -c 'exit 0'"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(run) --ttl-seconds rejects non-numeric input; docker-options stores it verbatim" {
run /bin/bash -c "dokku run --ttl-seconds '\$(id)' $TEST_APP echo hi"
echo "output: $output"
+28
View File
@@ -156,6 +156,34 @@ teardown() {
assert_output_contains "SECRET_KEY=fjdkslafjdk"
}
@test "(scheduler-k3s) dockerfile dokku run propagates the command exit code" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
INGRESS_CLASS=nginx install_k3s
run /bin/bash -c "dokku apps:create $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run deploy_app dockerfile-procfile dokku@$DOKKU_DOMAIN:$TEST_APP
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku --quiet run $TEST_APP sh -c 'exit 3'"
echo "output: $output"
echo "status: $status"
assert_exit_status 3
run /bin/bash -c "dokku --quiet run $TEST_APP sh -c 'exit 0'"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(scheduler-k3s) dockerfile dokku run resolves Procfile key" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"