Merge ~hloeung/content-cache-charm:master into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Barry Price
Approved revision: 683c6fab5158cd264c657db993cccd2fe42e0ba5
Merged at revision: 68515ed2ee86f8b5f1e1b4bb5a8f0397b5249d9f
Proposed branch: ~hloeung/content-cache-charm:master
Merge into: content-cache-charm:master
Diff against target: 66 lines (+11/-0)
5 files modified
reactive/content_cache.py (+3/-0)
tests/unit/files/content_cache_rendered_haproxy_test_output.txt (+2/-0)
tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt (+2/-0)
tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt (+2/-0)
tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt (+2/-0)
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+392271@code.launchpad.net

Commit message

Fixed passing through HAProxy backend options

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Barry Price (barryprice) wrote :

+1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 68515ed2ee86f8b5f1e1b4bb5a8f0397b5249d9f

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/content_cache.py b/reactive/content_cache.py
2index c3487d6..42c0997 100644
3--- a/reactive/content_cache.py
4+++ b/reactive/content_cache.py
5@@ -298,6 +298,9 @@ def configure_haproxy(): # NOQA: C901 LP#1825084
6 if backend_check_path:
7 new_cached_loc_conf['backend-check-path'] = backend_check_path
8 new_loc_conf['backend-check-path'] = backend_check_path
9+ backend_options = loc_conf.get('backend-options')
10+ if backend_options:
11+ new_loc_conf['backend-options'] = backend_options
12 new_cached_loc_conf['signed-url-hmac-key'] = loc_conf.get('signed-url-hmac-key')
13 # Pass through selected backend location configs, if defined.
14 for key in ('site-name', 'backend-inter-time', 'backend-tls'):
15diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
16index b09d77e..bd1bd1e 100644
17--- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
18+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
19@@ -177,6 +177,8 @@ backend backend-cached-site3-local
20 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
21
22 backend backend-site3-local
23+ option forwardfor except 127.0.0.1
24+ option forceclose
25 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk\r\nCache-Control:\ no-cache
26 http-request set-header Host site3.local
27 balance leastconn
28diff --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
29index 0b8a9f4..d7c2c0a 100644
30--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
31+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
32@@ -177,6 +177,8 @@ backend backend-cached-site3-local
33 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
34
35 backend backend-site3-local
36+ option forwardfor except 127.0.0.1
37+ option forceclose
38 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk\r\nCache-Control:\ no-cache
39 http-request set-header Host site3.local
40 balance leastconn
41diff --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
42index b2958cb..486f3a2 100644
43--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
44+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_load_balancing_algorithm.txt
45@@ -177,6 +177,8 @@ backend backend-cached-site3-local
46 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
47
48 backend backend-site3-local
49+ option forwardfor except 127.0.0.1
50+ option forceclose
51 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk\r\nCache-Control:\ no-cache
52 http-request set-header Host site3.local
53 balance roundrobin
54diff --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
55index 52e9cdd..4e64b08 100644
56--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
57+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_processes_and_threads.txt
58@@ -178,6 +178,8 @@ backend backend-cached-site3-local
59 server server_1 127.0.0.1:6082 check inter 2s rise 2 fall 60 maxconn 4096
60
61 backend backend-site3-local
62+ option forwardfor except 127.0.0.1
63+ option forceclose
64 option httpchk HEAD / HTTP/1.0\r\nHost:\ site3.local\r\nUser-Agent:\ haproxy/httpchk\r\nCache-Control:\ no-cache
65 http-request set-header Host site3.local
66 balance leastconn

Subscribers

People subscribed via source and target branches