Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.40.1: select with += causes node to be emptied instead of appending #1869

Closed
mkowalski opened this issue Nov 17, 2023 · 2 comments
Closed
Labels

Comments

@mkowalski
Copy link

Describe the bug
After upgrading from 4.35.2 to 4.40.1 there seems to be regression when using select combined with += causing the whole node to be emptied instead of appending the requested content.

Version of yq: 4.40.1
Operating system: Linux
Installed via: go install

Input Yaml
data1.yml:

spec:
  install:
    spec:
      clusterPermissions:
        - rules:
            - chocobomb:
                - "chocobomb"
          serviceAccountName: nmstate-operator

Command
The command you ran:

yq --inplace eval '.spec.install.spec.clusterPermissions[] |= select(.rules[]) |= select(.serviceAccountName == "nmstate-operator").rules += {"apiGroups":["security.openshift.io"],"resources":["securitycontextconstraints"],"verbs":["use"],"resourceNames":["privileged"]}' data1.yaml

Actual behavior

spec:
  install:
    spec:
      clusterPermissions:
        - {}

Expected behavior

spec:
  install:
    spec:
      clusterPermissions:
        - rules:
            - chocobomb:
                - "chocobomb"
            - apiGroups:
                - security.openshift.io
              resources:
                - securitycontextconstraints
              verbs:
                - use
              resourceNames:
                - privileged
          serviceAccountName: nmstate-operator
@mikefarah
Copy link
Owner

Thanks for raising! This will be fixed in the next release

@mikefarah
Copy link
Owner

Fixed in 4.40.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants