summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaw Loeung <[email protected]>2024-03-18 18:41:38 +1100
committerHaw Loeung <[email protected]>2024-03-18 18:41:38 +1100
commit5cb49959d5e4229ad5307182e3b053fdbbb73003 (patch)
tree36237830f6d3eb6eaaaab16d37fa03309f09b479
parent0036f064c70dc2ae41c109719639c7ff63214e21 (diff)
Pass through additional site names
-rw-r--r--reactive/content_cache.py1
-rw-r--r--tests/unit/files/content_cache_rendered_haproxy_test_output.txt3
-rw-r--r--tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt3
-rw-r--r--tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt3
-rw-r--r--tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt3
-rw-r--r--tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt3
6 files changed, 16 insertions, 0 deletions
diff --git a/reactive/content_cache.py b/reactive/content_cache.py
index eb22669..5e2dcb7 100644
--- a/reactive/content_cache.py
+++ b/reactive/content_cache.py
@@ -278,6 +278,7 @@ def configure_haproxy(): # NOQA: C901 LP#1825084
cache_port = site_conf['cache_port']
cached_site = 'cached-{}'.format(site)
new_conf[cached_site] = {'site-name': site_conf.get('site-name') or site, 'locations': {}}
+ new_conf[cached_site]['additional-site-names'] = site_conf.get('additional-site-names', [])
default_site = site_conf.get('default')
if default_site:
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
index 093376a..3cdf208 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
@@ -88,6 +88,9 @@ listen combined-80
use_backend backend-cached-site1-local if { hdr(Host) -i site1.local }
use_backend backend-cached-site3-local if { hdr(Host) -i site3.local }
use_backend backend-cached-site4-local if { hdr(Host) -i site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i mysite.site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i site4-alt.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i -m end .site4.local }
use_backend backend-cached-site5 if { hdr(Host) -i site5.local }
use_backend backend-cached-site6-local if { hdr(Host) -i site6.local }
use_backend backend-cached-site9-local if { hdr(Host) -i site9.local }
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
index e56ac81..c8597fc 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
@@ -88,6 +88,9 @@ listen combined-80
use_backend backend-cached-site1-local if { hdr(Host) -i site1.local }
use_backend backend-cached-site3-local if { hdr(Host) -i site3.local }
use_backend backend-cached-site4-local if { hdr(Host) -i site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i mysite.site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i site4-alt.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i -m end .site4.local }
use_backend backend-cached-site5 if { hdr(Host) -i site5.local }
use_backend backend-cached-site6-local if { hdr(Host) -i site6.local }
use_backend backend-cached-site9-local if { hdr(Host) -i site9.local }
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
index 5f7bc95..0e8186d 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
@@ -88,6 +88,9 @@ listen combined-80
use_backend backend-cached-site1-local if { hdr(Host) -i site1.local }
use_backend backend-cached-site3-local if { hdr(Host) -i site3.local }
use_backend backend-cached-site4-local if { hdr(Host) -i site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i mysite.site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i site4-alt.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i -m end .site4.local }
use_backend backend-cached-site5 if { hdr(Host) -i site5.local }
use_backend backend-cached-site6-local if { hdr(Host) -i site6.local }
use_backend backend-cached-site9-local if { hdr(Host) -i site9.local }
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
index d5688d6..654c05c 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
@@ -89,6 +89,9 @@ listen combined-80
use_backend backend-cached-site1-local if { hdr(Host) -i site1.local }
use_backend backend-cached-site3-local if { hdr(Host) -i site3.local }
use_backend backend-cached-site4-local if { hdr(Host) -i site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i mysite.site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i site4-alt.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i -m end .site4.local }
use_backend backend-cached-site5 if { hdr(Host) -i site5.local }
use_backend backend-cached-site6-local if { hdr(Host) -i site6.local }
use_backend backend-cached-site9-local if { hdr(Host) -i site9.local }
diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
index 5b54864..c6f1ad8 100644
--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads_haproxy2.txt
@@ -88,6 +88,9 @@ listen combined-80
use_backend backend-cached-site1-local if { hdr(Host) -i site1.local }
use_backend backend-cached-site3-local if { hdr(Host) -i site3.local }
use_backend backend-cached-site4-local if { hdr(Host) -i site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i mysite.site4.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i site4-alt.local }
+ use_backend backend-cached-site4-local if { hdr(Host) -i -m end .site4.local }
use_backend backend-cached-site5 if { hdr(Host) -i site5.local }
use_backend backend-cached-site6-local if { hdr(Host) -i site6.local }
use_backend backend-cached-site9-local if { hdr(Host) -i site9.local }