Skip to content

Commit

Permalink
[DCK] Add all domains to external database connection
Browse files Browse the repository at this point in the history
  • Loading branch information
josep-tecnativa committed Oct 28, 2024
1 parent f3df4ad commit 319c0e3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions _traefik3_paths_labels.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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(ns.all_hosts) }}

{#- Remember basic middlewares for this domain group #}
{%- set _ns = namespace(basic_middlewares=[]) -%}
{%- if cidr_whitelist %}
Expand Down

0 comments on commit 319c0e3

Please sign in to comment.