Merge pull request #6681 from dokku/k3s-ingress-per-domain
Migrate to single ingress per app/domain combination
This commit is contained in:
@@ -32,3 +32,33 @@ teardown_() {
|
||||
|
||||
INGRESS_CLASS=nginx TAINT_SCHEDULING=true install_k3s
|
||||
}
|
||||
|
||||
@test "(scheduler-k3s) deploy dockerfile exposed port" {
|
||||
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 /bin/bash -c "dokku domains:set $TEST_APP $TEST_APP.dokku.me"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:from-image $TEST_APP metabase/metabase:latest"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "sleep 30"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_http_localhost_response_contains "http" "$TEST_APP.dokku.me" "80" "" "<title>Metabase</title>"
|
||||
}
|
||||
|
||||
@@ -238,6 +238,22 @@ assert_http_localhost_response() {
|
||||
fi
|
||||
}
|
||||
|
||||
assert_http_localhost_response_contains() {
|
||||
local scheme="$1" domain="$2" port="${3:-80}" path="${4:-}" content="${5:-}" status_code="${6:-200}"
|
||||
run curl --connect-to "$domain:$port:localhost:$port" -kSso /dev/null -w "%{http_code}" "$scheme://$domain:$port$path"
|
||||
echo "curl: curl --connect-to $domain:$port:localhost:$port -kSso /dev/null -w %{http_code} $scheme://$domain:$port$path"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "$status_code"
|
||||
|
||||
if [[ -n "$content" ]]; then
|
||||
run curl --connect-to "$domain:$port:localhost:$port" -kSs "$scheme://$domain:$port$path"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "$content"
|
||||
fi
|
||||
}
|
||||
|
||||
assert_ssl_domain() {
|
||||
local domain=$1
|
||||
assert_app_domain "${domain}"
|
||||
|
||||
Reference in New Issue
Block a user