On 03/21/2017 07:54 PM, Frederic Lecaille wrote:
Hello HAProxy ML,

I am starting this new thread to publish a serie of patches to make
all "server" settings be supported on "default-server" lines.

This is a preliminary work for "server templates" feature.

New boolean settings have been added to disable others. Most of them
have "no-" as prefix.

[snipped]

So, from now on, all server "settings" are supported by "default-server"
except "id" which is only supported on "server" lines.

Before all theses patches, if an unknown "foo" keyword was provided on "default-server" or "server" lines, such error messages were displayed:

[ALERT] 081/110011 (11626) : parsing [haproxy.cfg:97] : 'server srv1' unknown keyword 'foo'. Registered keywords :
    [ ALL] id <arg>
    [ TCP] tcp-ut <arg>
    [ SSL] ca-file <arg>
    .
    .
etc.

[ALERT] 081/110011 (11626) : Error(s) found in configuration file : haproxy.cfg
[ALERT] 081/110011 (11626) : Fatal errors found in configuration.

Only registered by srv_register_keywords() in 'srv_kwst list keywords were displayed.

Most of this thread patches register new keywords in this lists.

So now, the new error messages are:

[ALERT] 081/111458 (12190) : parsing [haproxy.cfg:97] : 'server srv1' unknown keyword 'foo'. Registered keywords :
    [ SSL] ca-file <arg> [dflt_ok]
    [ SSL] check-ssl [dflt_ok]
    [ SSL] ciphers <arg> [dflt_ok]
    [ SSL] crl-file <arg> [dflt_ok]
    [ SSL] crt <arg> [dflt_ok]
    [ SSL] force-sslv3 [dflt_ok]
    [ SSL] force-tlsv10 [dflt_ok]
    .
    .
    [snipped]
    .
    [ ALL] id <arg>
    [ ALL] namespace <arg> [dflt_ok]
    [ ALL] no-agent-check [dflt_ok]
    [ ALL] no-backup [dflt_ok]

From my point of view, this is not acceptable to flag all these settings as supported on "default-server" lines.

At this time, as "id" remains as unique setting supported by "server", the patch attached to this mail now produces these error messages:

[ALERT] 081/111458 (12190) : parsing [haproxy.cfg:97] : 'server srv1' unknown keyword 'foo'. Registered keywords :
    [ SSL] ca-file <arg>
    [ SSL] check-ssl
    [ SSL] ciphers <arg>
    [ SSL] crl-file <arg>
    [ SSL] crt <arg>
    [ SSL] force-sslv3
    [ SSL] force-tlsv10
    .
    .
    [snipped]
    .
    [ ALL] id <arg> [server_only]
    [ ALL] namespace <arg>
    [ ALL] no-agent-check
    [ ALL] no-backup [dflt_ok]


It does not make sens to backport this patch. It is only supposed to be
used to fix the boring error messages this thread patches introduced.


>From 94f81538cc6b9f042800b47bb57cc5e1e4a9ee24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= <flecai...@haproxy.com>
Date: Thu, 23 Mar 2017 11:39:10 +0100
Subject: [PATCH] MINOR: server: Display only server keywords which are only
 supported on "server" lines.
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4

When displaying error messages when parsing unknown "server" keywords,
in place of flagging keywords which are also supported on "default-server" lines,,
and as in the future almost all "server" setting will be supported by "default-server",
this patch make the error message handlers flag only keywords which are only
supported on server lines.

Does not make sense to be backported.
---
 src/server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/server.c b/src/server.c
index 5589723..1b02ee5 100644
--- a/src/server.c
+++ b/src/server.c
@@ -206,7 +206,7 @@ void srv_dump_kws(char **out)
 				          kwl->scope,
 				          kwl->kw[index].kw,
 				          kwl->kw[index].skip ? " <arg>" : "",
-				          kwl->kw[index].default_ok ? " [dflt_ok]" : "",
+				          kwl->kw[index].default_ok ? "" : " [server_only]",
 				          kwl->kw[index].parse ? "" : " (not supported)");
 			}
 		}
-- 
2.1.4

Reply via email to