Re: Easy but useful feature missing, anyone interested ?

2020-09-30 Thread Amaury Denoyelle
Willy Tarreau  wrote:

> Hi all,
> while revisiting pending issues, I've come across this one, about
> the impossibility for an environment variable to produce multiple
> words in the configuration:
> https://github.com/haproxy/haproxy/issues/165
> It can be trivially addressed by adding support for ${VAR[*]} to the
> config language. This addition is relatively simple to do, roughly
> speaking, simply add the code in parse_line() in the "if" block dealing
> with "$", detect the presence of '[', terminate the variable name here,
> raise a flag, then once the variable is resolved, increase arg for each
> space found.
> We've missed it for 2.2 already, it would be nice if someone interested
> in this feature could have a look at it before we release 2.3. I'm OK
> with merging it slightly late given that the side effects are quickly
> tested.

FIY, I have looked upon the issue and seems to have now a working
implementation. I will probably be able to produce a clean patch soon.

-- 
Amaury Denoyelle



Re: Easy but useful feature missing, anyone interested ?

2020-09-30 Thread Willy Tarreau
On Wed, Sep 30, 2020 at 08:40:40AM +0200, Amaury Denoyelle wrote:
> At the moment I'm always interested to add simple feature, but I also
> would like to progress with my patch serie on stats so I'm not sure if I
> will have the time for this :/

Yes please, I'd like to merge your final stats series ASAP so that we
still have a bit of time left for final adjustments before the release.

Willy



Re: Easy but useful feature missing, anyone interested ?

2020-09-30 Thread Amaury Denoyelle
Willy Tarreau  wrote:

> Hi all,
> while revisiting pending issues, I've come across this one, about
> the impossibility for an environment variable to produce multiple
> words in the configuration:
> https://github.com/haproxy/haproxy/issues/165
> It can be trivially addressed by adding support for ${VAR[*]} to the
> config language. This addition is relatively simple to do, roughly
> speaking, simply add the code in parse_line() in the "if" block dealing
> with "$", detect the presence of '[', terminate the variable name here,
> raise a flag, then once the variable is resolved, increase arg for each
> space found.
> We've missed it for 2.2 already, it would be nice if someone interested
> in this feature could have a look at it before we release 2.3. I'm OK
> with merging it slightly late given that the side effects are quickly
> tested.
> In the same vein, I've long been saying that we're missing an ifdef
> mechanism, but if we had $(if,cond,true,false) like makefiles, we could
> already do a lot, particularly in the regtests. There's quite more work
> here (define expressions for the condition, internal variable names for
> version and builtin options, recursive resolving of variable names), but
> it's likely that the same person(s) might be interested.
> If someone's interested in having a look at that, please let me know.
> There's no shame in trying and not succeeding, don't worry :-)

At the moment I'm always interested to add simple feature, but I also
would like to progress with my patch serie on stats so I'm not sure if I
will have the time for this :/

-- 
Amaury Denoyelle



Easy but useful feature missing, anyone interested ?

2020-09-29 Thread Willy Tarreau
Hi all,

while revisiting pending issues, I've come across this one, about
the impossibility for an environment variable to produce multiple
words in the configuration:

https://github.com/haproxy/haproxy/issues/165

It can be trivially addressed by adding support for ${VAR[*]} to the
config language. This addition is relatively simple to do, roughly
speaking, simply add the code in parse_line() in the "if" block dealing
with "$", detect the presence of '[', terminate the variable name here,
raise a flag, then once the variable is resolved, increase arg for each
space found.

We've missed it for 2.2 already, it would be nice if someone interested
in this feature could have a look at it before we release 2.3. I'm OK
with merging it slightly late given that the side effects are quickly
tested.

In the same vein, I've long been saying that we're missing an ifdef
mechanism, but if we had $(if,cond,true,false) like makefiles, we could
already do a lot, particularly in the regtests. There's quite more work
here (define expressions for the condition, internal variable names for
version and builtin options, recursive resolving of variable names), but
it's likely that the same person(s) might be interested.

If someone's interested in having a look at that, please let me know.
There's no shame in trying and not succeeding, don't worry :-)

Thanks,
Willy