BUG/MINOR: server: fix first server template not being indexed
3.0-dev1 introduced a small regression with commit b4db3be86e
("BUG/MINOR:
server: fix server_find_by_name() usage during parsing"). By changing the
way servers are indexed and moving it into the server template loop, the
first one is no longer indexed because the loop starts at low+1 since it
focuses on duplication. Let's index the first one explicitly now.
This should not be backported, unless the commit above is backported.
This commit is contained in:
parent
0091692d97
commit
7223296092
@ -3017,6 +3017,12 @@ static int _srv_parse_tmpl_init(struct server *srv, struct proxy *px)
|
||||
int i;
|
||||
struct server *newsrv;
|
||||
|
||||
/* Set the first server's ID. */
|
||||
_srv_parse_set_id_from_prefix(srv, srv->tmpl_info.prefix, srv->tmpl_info.nb_low);
|
||||
srv->conf.name.key = srv->id;
|
||||
ebis_insert(&curproxy->conf.used_server_name, &srv->conf.name);
|
||||
|
||||
/* then create other servers from this one */
|
||||
for (i = srv->tmpl_info.nb_low + 1; i <= srv->tmpl_info.nb_high; i++) {
|
||||
newsrv = new_server(px);
|
||||
if (!newsrv)
|
||||
|
Loading…
Reference in New Issue
Block a user