mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Merge pull request #2744 from fraenki/haproxy_390a
net/haproxy: additions for release 3.9
This commit is contained in:
@@ -11,6 +11,9 @@ Plugin Changelog
|
||||
Added:
|
||||
* add SSL SNI setting to servers and health checks (#2388)
|
||||
|
||||
Fixed:
|
||||
* fix custom TCP health checks (#2653)
|
||||
|
||||
Changed:
|
||||
* replace "force SSL" setting with "SSL preferences" in health checks (#2388)
|
||||
* health check port is no longer an advanced option
|
||||
|
||||
@@ -1487,25 +1487,29 @@ backend {{backend.name}}
|
||||
{% set healthcheck_enabled = '0' %}
|
||||
{% elif healthcheck_data.type == 'tcp' %}
|
||||
{# # custom TCP health check option #}
|
||||
{# # TODO: add support for multiple send/expect steps, see plugins/#2653 #}
|
||||
{% if healthcheck_data.tcp_enabled|default("") == '1' %}
|
||||
{# # validate options: both must not be disabled at the same time #}
|
||||
{# # check if any of the required values can be found #}
|
||||
{% if healthcheck_data.tcp_sendValue|default("") == "" and healthcheck_data.tcp_matchValue|default("") == "" %}
|
||||
# ERROR: invalid custom TCP health check, missing "sendValue" or "matchValue"
|
||||
# ERROR: invalid custom TCP health check, missing send/expect data
|
||||
{% else %}
|
||||
option tcp-check
|
||||
{# # check for "send" value #}
|
||||
{% if healthcheck_data.tcp_sendValue|default("") != "" %}
|
||||
tcp-check send {{healthcheck_data.tcp_sendValue}}
|
||||
{% endif %}
|
||||
{% set healthcheck_customtcp = [] %}
|
||||
{% do healthcheck_customtcp.append('send ' ~ healthcheck_data.tcp_sendValue) if healthcheck_data.tcp_sendValue|default("") != "" %}
|
||||
{% if healthcheck_data.tcp_matchValue|default("") != "" %}
|
||||
{% do healthcheck_customtcp.append('expect ' ~ healthcheck_data.tcp_matchType) %}
|
||||
{% do healthcheck_customtcp.append(healthcheck_data.tcp_matchType) %}
|
||||
{% if healthcheck_data.tcp_negate == '1' and healthcheck_data.tcp_matchType|default("") != 'binary' %}
|
||||
{% do healthcheck_customtcp.append('!') %}
|
||||
{% endif %}
|
||||
{% do healthcheck_customtcp.append(healthcheck_data.tcp_matchValue) %}
|
||||
{% endif %}
|
||||
{# # XXX: some values (send/match) must be properly escaped (whitespace) #}
|
||||
{# # TODO: add support for multiple send/expect steps #}
|
||||
option tcp-check
|
||||
tcp-check connect
|
||||
tcp-check {{healthcheck_customtcp|join(' ')}}
|
||||
{# # check for "expect" value #}
|
||||
{% if (healthcheck_customtcp|length > 0 ) %}
|
||||
tcp-check expect {{healthcheck_customtcp|join(' ')}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% elif healthcheck_data.type == 'http' %}
|
||||
|
||||
Reference in New Issue
Block a user