Skip to content

bug: when-condition 'contains' operator unsupported in Argo v4 — use =~ instead #155

@hanthor

Description

@hanthor

Bug

The run-smoke, run-developer, and run-software DAG tasks in bluefin-qa-pipeline use a when expression with the contains operator, which is not a valid operator in Argo Workflows' expression evaluator.

Error

Invalid 'when' expression ''smoke' contains 'smoke'': Cannot transition token types from STRING [smoke] to VARIABLE [contains]

Root Cause

Argo's when field uses a limited expression evaluator (govaluate-based) that does not support contains as an infix operator. The contains operator is only valid for array membership checks, not string substring matching.

Affected lines

bluefin-qa-pipeline.yaml, run-smoke / run-developer / run-software tasks:

when: "'\{\{workflow.parameters.suites\}\}' contains 'smoke'"

Fix

Replace contains with =~ (regex match):

when: "'\{\{workflow.parameters.suites\}\}' =~ 'smoke'"

The suites parameter is a comma-separated string like "smoke" or "smoke,developer", so a regex substring match is equivalent to the intended behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:clusterCore cluster, platform, or GitOps plumbingkind:bugSomething brokenpriority:p1High prioritysource:agentFiled or updated by an agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions