Project

General

Profile

Actions

Bug #24226

closed

rudderc canonifies already canonified condition expression resulting in loss of logic operators such as ) and |

Added by Félix DALLIDET 9 months ago. Updated 9 months ago.

Status:
Released
Priority:
N/A
Category:
rudderc
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
I hate Rudder for that
User visibility:
First impressions of Rudder
Effort required:
Small
Priority:
196
Name check:
To do
Fix check:
Checked
Regression:
No

Description

See the following yaml as example:

id: os_condition_logic_or_
name: 'OS condition logic OR '
version: '1.0'
category: ncf_techniques
items:
  - id: 74537fd1-bbb7-460e-bf2c-dcfc341c2fe0
    name: logic with or
    condition: ubuntu_22_04|centos_8
    method: file_present
    params:
      path: /tmp/os-condition-or
  - id: 8421d610-ebc6-4a2f-b3de-f04fb101e944
    name: for ubuntu 22.04.03
    condition: ubuntu_22_04
    method: file_present
    params:
      path: /tmp/os-condition-only-ubuntu22
  - id: b63fc018-b2d8-4f4b-8535-b4143e760779
    name: for centos 8
    condition: centos_8
    method: file_present
    params:
      path: /tmp/os-condition-only-centos8

The first section will never be executed as the generated cfengine code is the following:

bundle agent call_os_condition_logic_or__74537fd1_bbb7_460e_bf2c_dcfc341c2fe0(c_name, c_key, report_id, args, class_prefix, method_call_condition, path) {
  methods:
    "74537fd1-bbb7-460e-bf2c-dcfc341c2fe0_${report_data.directive_id}" usebundle => _method_reporting_context_v4("${c_name}", "${c_key}", "${report_id}");
    "74537fd1-bbb7-460e-bf2c-dcfc341c2fe0_${report_data.directive_id}" usebundle => file_present("${path}"),
                                             if => canonify("${method_call_condition}");

Where `method_call_condition` is `"ubuntu_22_04|centos_8"` which must NOT be canonified again.


Files

os_condition_logic_validation.yml (880 Bytes) os_condition_logic_validation.yml Elaad FURREEDAN, 2024-02-28 11:07

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #24291: Add integration tests to ruddercReleasedFélix DALLIDETActions
Actions

Also available in: Atom PDF