Project

General

Profile

Actions

Bug #22535

closed

Mustache template is not capable to render technique parameters on windows nodes

Added by Félix DALLIDET over 1 year ago. Updated over 1 year ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
I hate Rudder for that
User visibility:
Getting started - demo | first install | Technique editor and level 1 Techniques
Effort required:
Small
Priority:
157
Name check:
To do
Fix check:
Checked
Regression:
No

Description

The current windows technique generated by the webapp does not register the technique parameters as a global variable for the technique run, it should.

function Super-Technique-To-Test-Everything {
  [CmdletBinding()]
  param (
      [parameter(Mandatory=$true)]
      [string]$reportId,
      [parameter(Mandatory=$true)]
      [string]$techniqueName,
      [parameter(Mandatory=$true)]
      [string]$one_params,
      [parameter(Mandatory=$true)]
      [string]$two_params,
      [Rudder.PolicyMode]$policyMode
  )
  BeginTechniqueCall -Name $techniqueName
.....
  EndTechniqueCall -Name $techniqueName
}

Should be:

function Super-Technique-To-Test-Everything {
  [CmdletBinding()]
  param (
      [parameter(Mandatory=$true)]
      [string]$reportId,
      [parameter(Mandatory=$true)]
      [string]$techniqueName,
      [parameter(Mandatory=$true)]
      [string]$one_params,
      [parameter(Mandatory=$true)]
      [string]$two_params,
      [Rudder.PolicyMode]$policyMode
  )

  $techniqueParams = @{
    "one_params" = $one_params
    "two_params" = $two_params
  }
  BeginTechniqueCall -Name $techniqueName -Parameters $techniqueParams
  .....
  EndTechniqueCall -Name $techniqueName

Where BeginTechniqueCall will have an additional code looking like this:

  Add-PolicyRudderVar -Name $techniqueName -Value $techniqueParams

The Add-PolicyRudderVar is named Rudder-Var in 7.3+ and is present in the agent modules. But for 7.2 compatibility we will most likely have to backport it in ncf.


Subtasks 3 (0 open3 closed)

Bug #22536: Add two functions to ncf to manage rudder policy variablesReleasedVincent MEMBRÉActions
Bug #22537: 7.3 version of parent ticketReleasedVincent MEMBRÉActions
Bug #22567: Add-RudderVar is not packaged anymore in the agent on ci buildsReleasedAlexis MoussetActions
Actions

Also available in: Atom PDF