Add wildcard support for contains and render with match()
This used MatchAny explicitly, since we check against an array here.
When a user specifies an filter like this in Director:
host.groups contains "customer*"
The Director should render it as:
assign where match("customer*", host.groups, MatchAny)
For backwards compatibility I wouldn't change wildcards with =, but for contains this new behavior here should be expected.
ref/NC/620757
@lazyfrosch: thanks, this would make a nice feature. Did you test whether our (Web) Filters are able to calculate the same result? There must be a discrepancy either before or after this modification I guess
@Thomas-Gelf How would this be related to the web filters? The AssignRenderer is already quite specific to Director. I've only added the recognition of wildcards with the contains logic
Please see the updated unit test.
@lazyfrosch: relation to web filters -> we cannot deploy Filters we're unable to evaluate by ourselves
I still don't get the point, sorry.
ObjectApplyMatches must provide the same result as Icinga 2. Either it currently behaves differently than the core, or it will do so after this patch
Any update on this? @lazyfrosch @Thomas-Gelf
We just stumbled upon this, as we have hosts with an array variable filled with tags.
Now having an apply rule like host.vars.tags contains "tag_thistag" works without problems, but host.vars.tags contains "tag_handle_*" does not. This forces us to use the Icinga DSL and config files for certain things.
Is this to be expected to work any time soon?
Can we expect this in release 1.9? Because of the missing possibility to add a "MatchAny" we have to maintain .conf files in addition to the director configuration.
Hi @Thomas-Gelf @lazyfrosch is there any chance this will be pulled and put in a release ? We have a big customer which we need to patch at every update.
I haven't been involved with Icinga for a while now, hopefully this will get merged some day...
@Thomas-Gelf have you had the chance to review this PR ? thanks Oreste
ref/IP/52313