Hi,

Working on TC-121 <https://issues.apache.org/jira/browse/TC-121>, allowing
variables to be evaluated as part of a traffic-server parameter, made me
realize that the simple solution of variable substitution is might not be
strong enough.

As an example, lets take traffic server ip bind configuration.
Setting :
LOCAL proxy.local.incoming_ip_to_bind
to be:
STRING __CACHE_IPv4__ [__CACHE_IPv6__]

If the server's IPv6 address is set, it will work nicely.
But if the IPv6 is not set, we will end up with an invalid configuration.

As far as I know, a single profile cannot support both use-cases.
Separating into 2 profile is not scalable. Splitting a profile for this
purpose may result with many profiles, with small differences between them,
which are hard to follow and identify.

I would like to suggest an improvement that

   - Allow a parameter to be optional.
   - Allow some logic in the evaluation of the parameter's value.

This can be achieved by using expressions to be evaluated in the
parameter's value.
The syntax of course, needs to be discussed, but lets say for example that:
__COND_BEGIN__/__COND_END__ delimits a condition to be evaluated:
One may set a value to be:
STRING __CACHE_IPv4__ __COND_BEGIN__ __CACHE_IPv6__!="" ? [__CACHE_IPv6__] :
 ""__COND_END__
Having the IPv6 part in the result only if set.

Furthermore, a special evaluation result string (e.g. __NA__) may identify
parameters that should be omitted from the server's configuration.


I would appreciate your view on the issue.

Thanks,
Nir

Reply via email to