Bug #19866
closedRudderlang must support dynamic built classes
Description
When editing a technique, it is a common usecase to use a variable call in a "condition" field.
It does not seem to be possible to recreate such beahviour in rudderlang at the moment.
For instance, here I want to define a prefix from a string variable, which will be used in my condition field later.
This is possible from the technique editor, by defining a "variable from string", and them calling it in the condition field of the block parameter.
let bench = "CIS_RHEL7" condition("${bench}_1_1_1_1").from_variable_existence("node.properties[${bench}][1.1.1.1]") if "${bench}_1_1_1_1_false" => { command("lsmod | grep -q cramfs").execution_result("1", "") command("modprobe -n -v cramfs | grep -qE 'install (/bin/true|/bin/false)'").execution_result("1", "") }
But when compiling this in rudderlang, I have the following error:
An error occurred, could not create content from 'technique.rd': technique.rd:37:7 near 'if "${bench}_1_1_1_1_false" =>' !--> The following keyword was expected: 'enum expression'. An error occurred, could not create content: Command was "/opt/rudder/bin/rudderc" "technique" "read" "-i" "technique.rd"
In fact, the conditions inputs in rudderlang seem to only expect static class types of variable. And we are unable to build them dynamically from string manipulation.
Updated by Benoît PECCATTE about 3 years ago
There should be a language syntax for this like:
let local_bool = variable_exist("node.properties[${bench}][1.1.1.1]") if local_bool => { ... }
Updated by François ARMAND about 3 years ago
- Target version changed from 7.0.0~beta1 to 900
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 900 to 7.0.0~beta2
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 7.0.0~beta2 to 7.0.0~beta3
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 7.0.0~beta3 to 7.0.0~rc1
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 7.0.0~rc1 to 7.0.0~rc2
Updated by Vincent MEMBRÉ almost 3 years ago
- Target version changed from 7.0.0~rc2 to 7.0.0~rc3
Updated by Vincent MEMBRÉ almost 3 years ago
- Target version changed from 7.0.0~rc3 to 7.0.0
Updated by Vincent MEMBRÉ almost 3 years ago
- Target version changed from 7.0.0 to 7.0.1
Updated by Alexis Mousset almost 3 years ago
- Target version changed from 7.0.1 to 7.1.0~beta1
Updated by Vincent MEMBRÉ over 2 years ago
- Target version changed from 7.1.0~beta1 to 7.1.0~beta2
Updated by Vincent MEMBRÉ over 2 years ago
- Target version changed from 7.1.0~beta2 to 7.1.0~rc1
Updated by Alexis Mousset over 2 years ago
- Target version changed from 7.1.0~rc1 to 7.2.0~beta1
Updated by Alexis Mousset over 2 years ago
- Status changed from New to Rejected
Closing for now as the language is on hold.