From 552ac018370f877dcac36831e5a6bb8af0a11c2d Mon Sep 17 00:00:00 2001 From: antromeo <45900043+antromeo@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:15:57 +0100 Subject: [PATCH 1/2] ENG-5355: removes fallback in FORCE_URL_SCHEME --- s/ecr-utils.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/s/ecr-utils.sh b/s/ecr-utils.sh index 0f0b0744..729727ca 100644 --- a/s/ecr-utils.sh +++ b/s/ecr-utils.sh @@ -19,17 +19,16 @@ ecr-prepare-action() { app-get-main-ingresses url_scheme main_ingress ecr_ingress ignored [ -z "$main_ingress" ] && FATAL "Unable to determine the main ingress url (s1)" [ -z "$ecr_ingress" ] && FATAL "Unable to determine the ecr ingress url (s1)" - if [ -n "$url_scheme" ]; then - main_ingress="$url_scheme://$main_ingress" - else - case "$FORCE_URL_SCHEME" in + case "$FORCE_URL_SCHEME" in "http") - http-get-working-url main_ingress "http://$main_ingress" "https://$main_ingress" + url_scheme=http ;; - *) - http-get-working-url main_ingress "https://$main_ingress" "http://$main_ingress" + "https") + url_scheme="https" ;; - esac + esac + if [ -n "$url_scheme" ]; then + main_ingress="$url_scheme://$main_ingress" fi [ -z "$main_ingress" ] && FATAL "Unable to determine the main ingress url (s2)" http-get-url-scheme url_scheme "$main_ingress" From e300cba3e85568392b42ef9bc32a376b42b7e3a7 Mon Sep 17 00:00:00 2001 From: antromeo <45900043+antromeo@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:18:55 +0100 Subject: [PATCH 2/2] ENG-5355: removes http-get-working-url function --- s/utils.sh | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/s/utils.sh b/s/utils.sh index 3b98755f..b60146d3 100644 --- a/s/utils.sh +++ b/s/utils.sh @@ -899,23 +899,6 @@ http-get-url-scheme() { _set_var "$1" "${2//:\/\/*/}" } -http-get-working-url() { - local res_var="$1" - shift - local res - if http-check "$1" --accept-401; then - res="$1" - else - if http-check "$2" --accept-401; then - res="$2" - else - res="" - fi - fi - - _set_var "$res_var" "$res" -} - #----------------------------------------------------------------------------------------------------------------------- # Retrieve the main application ingresses: # $1: var for the scheme