Skip to content

Regression: alternative not triggering since 4.45.3 #2469

@skitt

Description

@skitt

Describe the bug

Since 4.45.3, an expression we were using with a default specified using // no longer outputs the default. I imagine this is related to other issues involving // around that time frame.

Version of yq: 4.45.3, still present in 4.47.2
Operating system: Linux
Installed via: binary release

Input Yaml

data1.yml:

---
clusters:
  cluster1:
  cluster2:

Command

The command you ran:

yq e ".clusters[] | select(. | has(\"broker\")) | path | .[-1] // \"cluster1\""

Actual behavior

Expected behavior

cluster1

Additional context

We are relying on Fedora packages, which is why this didn’t turn up earlier — Fedora recently bumped from 4.43.1 to 4.47.1. I checked this with your binary releases and reproduced the issue so this isn’t a Fedora packaging problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions