Merge pull request #6700 from dokku/traefik-remove-priority

Remove traefik priority functionality
This commit is contained in:
Jose Diaz-Gonzalez
2024-03-12 23:29:49 -04:00
committed by GitHub
6 changed files with 3 additions and 54 deletions

View File

@@ -44,7 +44,6 @@ cmd-traefik-report-single() {
"--traefik-letsencrypt-email: $(fn-traefik-letsencrypt-email)"
"--traefik-letsencrypt-server: $(fn-traefik-letsencrypt-server)"
"--traefik-log-level: $(fn-traefik-log-level)"
"--traefik-priority: $(fn-traefik-priority "$APP")"
)
if [[ -z "$INFO_FLAG" ]]; then

View File

@@ -8,7 +8,7 @@ trigger-traefik-vhosts-docker-args-process-deploy() {
declare desc="nginx-vhosts core-post-deploy plugin trigger"
declare trigger="docker-args-process-deploy"
declare APP="$1" IMAGE_SOURCE_TYPE="$2" IMAGE_TAG="$3" PROC_TYPE="$4" CONTAINER_INDEX="$5"
local app_domains is_app_listening letsencrypt_email output proxy_container_port proxy_host_port port_map priority proxy_scheme proxy_schemes traefik_domains
local app_domains is_app_listening letsencrypt_email output proxy_container_port proxy_host_port port_map proxy_scheme proxy_schemes traefik_domains
local proxy_container_http_port proxy_container_http_port_candidate proxy_host_http_port_candidate
local proxy_container_https_port proxy_container_https_port_candidate proxy_host_https_port_candidate
local STDIN=$(cat)
@@ -87,11 +87,6 @@ trigger-traefik-vhosts-docker-args-process-deploy() {
traefik_domains="${traefik_domains// /\\\`,\\\`}"
fi
priority="$(fn-traefik-priority "$APP")"
if [[ -z "$priority" ]]; then
priority="$(date +%s)"
fi
output="--label traefik.enable=true"
if [[ -n "$proxy_container_http_port" ]] || [[ -n "$proxy_container_http_port_candidate" ]]; then
if [[ -z "$proxy_container_http_port" ]]; then
@@ -102,7 +97,6 @@ trigger-traefik-vhosts-docker-args-process-deploy() {
output="$output --label traefik.http.services.$APP-$PROC_TYPE-http.loadbalancer.server.port=$proxy_container_http_port"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-http.entrypoints=http"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-http.priority=$priority"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-http.service=$APP-$PROC_TYPE-http"
if [[ -n "$traefik_domains" ]]; then
output="$output --label \"traefik.http.routers.$APP-$PROC_TYPE-http.rule=Host(\\\`$traefik_domains\\\`)\""
@@ -118,7 +112,6 @@ trigger-traefik-vhosts-docker-args-process-deploy() {
output="$output --label traefik.http.services.$APP-$PROC_TYPE-https.loadbalancer.server.port=$proxy_container_https_port"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-https.entrypoints=https"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-https.priority=$priority"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-https.service=$APP-$PROC_TYPE-https"
output="$output --label traefik.http.routers.$APP-$PROC_TYPE-https.tls.certresolver=leresolver"
if [[ -n "$traefik_domains" ]]; then

View File

@@ -92,8 +92,3 @@ fn-traefik-log-level() {
log_level="$(fn-plugin-property-get-default "traefik" "--global" "log-level" "ERROR")"
echo "${log_level^^}"
}
fn-traefik-priority() {
declare APP="$1"
fn-plugin-property-get-default "traefik" "$APP" "priority" ""
}

View File

@@ -9,13 +9,13 @@ cmd-traefik-set() {
declare cmd="traefik:set"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" KEY="$2" VALUE="$3"
local VALID_KEYS=("api-enabled" "api-vhost" "dashboard-enabled" "basic-auth-username" "basic-auth-password" "image" "letsencrypt-email" "letsencrypt-server" "log-level" "priority")
local VALID_KEYS=("api-enabled" "api-vhost" "dashboard-enabled" "basic-auth-username" "basic-auth-password" "image" "letsencrypt-email" "letsencrypt-server" "log-level")
local GLOBAL_KEYS=("api-enabled" "api-vhost" "dashboard"-enabled "basic-auth-username" "basic-auth-password" "image" "letsencrypt-email" "letsencrypt-server" "log-level")
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
dokku_log_fail "Invalid key specified, valid keys include: api-enabled api-vhost dashboard-enabled basic-auth-username basic-auth-password image letsencrypt-email letsencrypt-server log-level priority"
dokku_log_fail "Invalid key specified, valid keys include: api-enabled api-vhost dashboard-enabled basic-auth-username basic-auth-password image letsencrypt-email letsencrypt-server log-level"
fi
if ! fn-in-array "$KEY" "${GLOBAL_KEYS[@]}"; then