File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ haproxy_master_pid=$(pgrep -P "$pid" -x haproxy)
46
46
47
47
< %- if p(" ha_proxy.enable_health_check_http" ) -%>
48
48
echo " disable frontend health_check_http_url" | /usr/local/bin/socat stdio unix-connect:${sockfile}
49
+ < %- if p(" ha_proxy.expect_proxy_cidrs" , []).size > 0 -%>
50
+ echo " disable frontend health_check_http_url_proxy_protocol" | /usr/local/bin/socat stdio unix-connect:${sockfile}
51
+ < %- end -%>
49
52
echo " $( date) : triggering grace period for process ${haproxy_master_pid} " >> ${logfile}
50
53
sleep < %= p(" ha_proxy.drain_frontend_grace_time" ) %>
51
54
< %- end -%>
Original file line number Diff line number Diff line change 31
31
expect ( drain ) . not_to include ( 'drain is disabled' )
32
32
expect ( drain ) . to include ( 'socat' )
33
33
end
34
+
35
+ context 'when PROXY CIDRs are provided' do
36
+ it 'includes the PROXY frontend in drain logic' do
37
+ drain = template . render (
38
+ {
39
+ 'ha_proxy' => {
40
+ 'drain_enable' => true ,
41
+ 'enable_health_check_http' => true ,
42
+ 'expect_proxy_cidrs' => [ '10.0.0.0/8' ]
43
+ }
44
+ }
45
+ )
46
+ expect ( drain ) . not_to include ( 'drain is disabled' )
47
+ expect ( drain ) . to include ( 'socat' )
48
+ expect ( drain ) . to include ( 'disable frontend health_check_http_url_proxy_protocol' )
49
+ end
50
+ end
34
51
end
35
52
36
53
context 'when a custom ha_proxy.drain_timeout is provided' do
You can’t perform that action at this time.
0 commit comments