BUG/MINOR: server: do not report diag for peer servers with null weight

Only check servers attached to a proxy with PR_CAP_LB.

This does not need to be backported as the diag message was added in the
current 2.4-dev branch.
This commit is contained in:
Amaury Denoyelle 2021-05-07 15:13:51 +02:00
parent b979f59871
commit 24abb0cdc1

View File

@ -2703,7 +2703,7 @@ int parse_server(const char *file, int linenum, char **args,
if (parse_flags & SRV_PARSE_TEMPLATE)
_srv_parse_tmpl_init(newsrv, curproxy);
HA_DIAG_WARNING_COND(!newsrv->uweight,
HA_DIAG_WARNING_COND((curproxy->cap & PR_CAP_LB) && !newsrv->uweight,
"parsing [%s:%d] : 'server %s' : configured with weight of 0 will never be selected by load balancing algorithms\n",
file, linenum, newsrv->id);