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

[BUG] salt-ssh state.* with pillar overrides: pillar dict and pillar in wrappers out of sync #65483

Closed
lkubb opened this issue Oct 29, 2023 · 1 comment · Fixed by #65484
Closed
Labels
Bug broken, incorrect, or confusing behavior needs-triage Salt-SSH

Comments

@lkubb
Copy link
Contributor

lkubb commented Oct 29, 2023

Description
When passing complex pillar overrides to salt-ssh state.sls etc., there will be a mismatch during template rendering. The pillar dict will contain the correct data, while calling the pillar.get wrapper module will return data that has not been recursively merged (all wrappers are affected). This is the master-side equivalent of #59802.

Setup
irrelevant

Steps to Reproduce the behavior

# a pillar targeted to the minion
monty: python
the_meaning:
  of:
    life: 42
    bar: tender
  for: what
# test.sls
deep_thought:
  test.show_notification:
    - text: '{{ {"raw": {"the_meaning": pillar.get("the_meaning"), "btw": pillar.get("btw")}, "wrapped": {"the_meaning": salt["pillar.get"]("the_meaning"), "btw": salt["pillar.get"]("btw")}} | json }}'

salt-ssh foo state.apply test pillar='{the_meaning: {of: {life: 2.71, foo: lish}}, btw: turtles}'

Expected behavior

foo:
----------
          ID: deep_thought
    Function: test.show_notification
      Result: True
     Comment: {"raw": {"btw": "turtles", "the_meaning": {"of": {"life": 2.71, "foo": "lish", "bar": "tender"}, "for": "what"}}, "wrapped": {"btw": "turtles", "the_meaning": {"of": {"life": 2.71, "foo": "lish", "bar": "tender"}, "for": "what"}}}
     Started: 18:18:36.786042
    Duration: 1.003 ms
     Changes:

Screenshots

foo:
----------
          ID: deep_thought
    Function: test.show_notification
      Result: True
     Comment: {"raw": {"btw": "turtles", "the_meaning": {"of": {"life": 2.71, "foo": "lish", "bar": "tender"}, "for": "what"}}, "wrapped": {"btw": "turtles", "the_meaning": {"of": {"life": 2.71, "foo": "lish"}}}}
     Started: 18:18:36.786042
    Duration: 1.003 ms
     Changes:

Notice the difference of raw and wrapped, the latter is the initial pillar .update()d with the overrides, the former the wanted, recursively merged one.

Versions Report
quite recent checkout of 3006.x branch, nothing has changed in master though

Additional context
Stumbled upon this while writing tests for a PR.

@lkubb lkubb added Bug broken, incorrect, or confusing behavior needs-triage labels Oct 29, 2023
@lkubb lkubb changed the title [BUG] salt-ssh state.* with pillar overrides: pillar dict and pillar.get exemod out of sync [BUG] salt-ssh state.* with pillar overrides: pillar dict and pillar.get wrapper out of sync Oct 29, 2023
@lkubb lkubb changed the title [BUG] salt-ssh state.* with pillar overrides: pillar dict and pillar.get wrapper out of sync [BUG] salt-ssh state.* with pillar overrides: pillar dict and pillar in wrappers out of sync Oct 29, 2023
@lkubb
Copy link
Contributor Author

lkubb commented Dec 12, 2023

Fixed by #65484

@lkubb lkubb closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage Salt-SSH
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants