From 4ae64b23c6f07f91f83f66cd2716266f974b0fe7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 11 Feb 2023 20:55:20 -0500 Subject: [PATCH] fix: update test to get the correct label for testing if ssl redirects are working properly --- plugins/haproxy-vhosts/docker-args-process-deploy | 2 ++ tests/unit/haproxy.bats | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/haproxy-vhosts/docker-args-process-deploy b/plugins/haproxy-vhosts/docker-args-process-deploy index 2688b7cb5..f08713a5e 100755 --- a/plugins/haproxy-vhosts/docker-args-process-deploy +++ b/plugins/haproxy-vhosts/docker-args-process-deploy @@ -122,6 +122,8 @@ trigger-haproxy-vhosts-docker-args-process-deploy() { if [[ -n "$haproxy_domains" ]]; then output="$output --label haproxy.$APP-$PROC_TYPE-https.host=$haproxy_domains" fi + else + output="$output --label haproxy.$APP-$PROC_TYPE.redirect_ssl=false" fi fi diff --git a/tests/unit/haproxy.bats b/tests/unit/haproxy.bats index e63526f59..cf74e6f67 100644 --- a/tests/unit/haproxy.bats +++ b/tests/unit/haproxy.bats @@ -117,11 +117,11 @@ teardown() { echo "status: $status" assert_success - run /bin/bash -c "docker inspect $TEST_APP.web.1 --format '{{ index .Config.Labels \"haproxy\" }}'" + run /bin/bash -c "docker inspect $TEST_APP.web.1 --format '{{ index .Config.Labels \"haproxy.$TEST_APP-web.redirect_ssl\" }}'" echo "output: $output" echo "status: $status" assert_success - assert_output "$TEST_APP.dokku.me:80" + assert_output "false" run /bin/bash -c "dokku haproxy:set --global letsencrypt-email test@example.com" echo "output: $output" @@ -148,11 +148,11 @@ teardown() { echo "status: $status" assert_success - run /bin/bash -c "docker inspect $TEST_APP.web.1 --format '{{ index .Config.Labels \"haproxy\" }}'" + run /bin/bash -c "docker inspect $TEST_APP.web.1 --format '{{ index .Config.Labels \"haproxy.$TEST_APP-web.redirect_ssl\" }}'" echo "output: $output" echo "status: $status" assert_success - assert_output "$TEST_APP.dokku.me" + assert_output "true" run /bin/bash -c "dokku proxy:report $TEST_APP --proxy-port-map" echo "output: $output"