From 928dc80f86ccdbcda8b36d855beb9ce84d9bde54 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 25 Oct 2024 11:02:56 +0200 Subject: [PATCH] [DCK] Add all domains to external database connection --- _traefik3_paths_labels.yml.jinja | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/_traefik3_paths_labels.yml.jinja b/_traefik3_paths_labels.yml.jinja index 67a843cb..d06e873d 100644 --- a/_traefik3_paths_labels.yml.jinja +++ b/_traefik3_paths_labels.yml.jinja @@ -233,9 +233,14 @@ {%- endfor %} {%- endif %} - {#- Apply rule to the first element in domain_groups_list #} - {%- set first_domain_group = domain_groups_list[0] %} - traefik.tcp.routers.{{ key }}-database.rule: {{ domains_rule_sni(first_domain_group) }} + {%- set all_hosts = [] %} + {%- set ns = namespace(all_hosts=[]) %} + {%- for domain_group in domain_groups_list %} + {%- set ns.all_hosts = ns.all_hosts + domain_group.hosts %} + {%- endfor %} + + traefik.tcp.routers.{{ key }}-database.rule: {{ domains_rule_sni(all_hosts) }} + {#- Remember basic middlewares for this domain group #} {%- set _ns = namespace(basic_middlewares=[]) -%} {%- if cidr_whitelist %}