]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: disable warnings for internal proxies
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 13 Aug 2021 13:21:12 +0000 (15:21 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 13 Aug 2021 13:34:16 +0000 (15:34 +0200)
The internal proxies should be part of the proxies list, because of
this, the check_config_validity() fonction could emit warnings about
these proxies.

This patch disables 3 startup warnings for internal proxies:

- "has no 'bind' directive" (this one was already ignored for the CLI
frontend, but we made it generic instead)
- "missing timeouts"
- "log format ignored"

src/cfgparse.c

index fafe7f7f27135e87f2ad9bc3a77ccfa0b0f4b275..113e30d3cb4007c39b9e93765c7705c4ef639604 100644 (file)
@@ -2554,7 +2554,7 @@ int check_config_validity()
                        break;
                }
 
-               if (curproxy != global.cli_fe && (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) {
+               if (!(curproxy->cap & PR_CAP_INT) && (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) {
                        ha_warning("%s '%s' has no 'bind' directive. Please declare it as a backend if this was intended.\n",
                                   proxy_type_str(curproxy), curproxy->id);
                        err_code |= ERR_WARN;
@@ -3115,7 +3115,7 @@ out_uri_auth_compat:
                } else
                        cfgerr += acl_find_targets(curproxy);
 
-               if ((curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) &&
+               if (!(curproxy->cap & PR_CAP_INT) && (curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) &&
                    (((curproxy->cap & PR_CAP_FE) && !curproxy->timeout.client) ||
                     ((curproxy->cap & PR_CAP_BE) && (curproxy->srv) &&
                      (!curproxy->timeout.connect ||
@@ -3348,7 +3348,7 @@ out_uri_auth_compat:
                if (curproxy->options & PR_O_LOGASAP)
                        curproxy->to_log &= ~LW_BYTES;
 
-               if ((curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) &&
+               if (!(curproxy->cap & PR_CAP_INT) && (curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HTTP) &&
                    (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->logsrvs) &&
                    (!LIST_ISEMPTY(&curproxy->logformat) || !LIST_ISEMPTY(&curproxy->logformat_sd))) {
                        ha_warning("log format ignored for %s '%s' since it has no log address.\n",