From 885e40494c5de6aee841222496d84dc718401fa0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 15 Mar 2024 09:08:08 +0100 Subject: [PATCH] MINOR: spoe: Add SPOE filters in the exposed deprecated directives It is the first deprecated directive exposed via the 'expose-deprecated-directives' global option. This way, it is possible to silent the warning about the SPOE uses. --- doc/configuration.txt | 3 ++- reg-tests/spoe/wrong_init.vtc | 5 +++++ src/flt_spoe.c | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 5b8188d61..aac245e95 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -26625,7 +26625,8 @@ the Stream Processing Offload Protocol (SPOP). For all information about the SPOE configuration and the SPOP specification, see "doc/SPOE.txt". -WARNING: The SPOE filter is now deprecated. +WARNING: The SPOE filter is now deprecated. Use 'expose-deprecated-directives' + to silent warnings if you must use it. 9.4. Cache ---------- diff --git a/reg-tests/spoe/wrong_init.vtc b/reg-tests/spoe/wrong_init.vtc index 152622c5e..7fbbfbe64 100644 --- a/reg-tests/spoe/wrong_init.vtc +++ b/reg-tests/spoe/wrong_init.vtc @@ -12,6 +12,11 @@ varnishtest "SPOE bug: missing configuration file" feature ignore_unknown_macro haproxy h1 -conf-BAD {} { + global +.if version_atleast(3.0-dev6) + expose-deprecated-directives +.endif + defaults timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" timeout client "${HAPROXY_TEST_TIMEOUT-5s}" diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 5623fec00..0c06bed77 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -4106,7 +4106,9 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, curpxopts2 = 0; - ha_warning("Proxy %s: SPOE filter is deprecated and will be removed in future version.\n", px->id); + if (!deprecated_directives_allowed) + ha_warning("Proxy %s: SPOE filter is deprecated and will be removed in future version. " + "Use 'expose-deprecated-directives' in global section to silent this warning\n", px->id); conf = calloc(1, sizeof(*conf)); if (conf == NULL) {