From a603811aac719814d5b24ca84f60751f0f3040eb Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 13 Jan 2026 16:13:27 +0100 Subject: [PATCH] MINOR: proxy: parse guid on dynamic backend creation Defines an extra optional GUID argument for "add backend" command. This can be useful as it is not possible to define it via a default proxy instance. --- doc/management.txt | 5 +++-- src/proxy.c | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/management.txt b/doc/management.txt index 43eed4507..5a256a8e7 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -1725,13 +1725,14 @@ add acl [@] This command cannot be used if the reference is a name also used with a map. In this case, the "add map" command must be used instead. -add backend from [mode ] [ EXPERIMENTAL ] +add backend from [mode ] [guid ] [ EXPERIMENTAL ] Instantiate a new backend proxy with the name . Only TCP or HTTP proxies can be created. All of the settings are inherited from default proxy instance. By default, it is mandatory to specify the backend mode via the argument of the same name, unless - already defines it explicitely. + already defines it explicitely. It is also possible to use an optional GUID + argument if wanted. Servers can be added via the command "add server". The backend is initialized in the unpublished state. Once considered ready for traffic, use "publish diff --git a/src/proxy.c b/src/proxy.c index 43651b515..eeed469b5 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -4787,7 +4787,7 @@ static int cli_parse_shutdown_frontend(char **args, char *payload, struct appctx static int cli_parse_add_backend(char **args, char *payload, struct appctx *appctx, void *private) { struct proxy *px, *defpx; - const char *be_name, *def_name, *err; + const char *be_name, *def_name, *guid = NULL, *err; char *msg = NULL; enum pr_mode mode = 0; @@ -4829,9 +4829,13 @@ static int cli_parse_add_backend(char **args, char *payload, struct appctx *appc return 1; } } + /* guid */ + else if (*args[2] && !guid && strcmp(args[1], "guid") == 0) { + guid = args[2]; + } /* unknown, malformed or duplicate argument */ else { - cli_err(appctx, "Usage: add backend from [mode ].\n"); + cli_err(appctx, "Usage: add backend from [mode ] [guid ].\n"); return 1; } -- 2.47.3