Skip to content

[master] Access pillar data while rendering pillars - #64043

Merged
dwoz merged 24 commits into
saltstack:masterfrom
dwoz:pillarwhilerender
Apr 15, 2026
Merged

dwoz merged 24 commits into
saltstack:masterfrom
dwoz:pillarwhilerender

Conversation

@dwoz

@dwoz dwoz commented Apr 8, 2023 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Pillar dunder is now available in extension modules during pillar render

Fixes: #65724

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

@dwoz
dwoz requested a review from a team as a code owner April 8, 2023 17:26
@dwoz
dwoz requested review from twangboy and removed request for a team April 8, 2023 17:26
@salt-project-bot-prod-environment salt-project-bot-prod-environment Bot changed the title [WIP] Access pillar data while rendering pillars [master][WIP] Access pillar data while rendering pillars Apr 8, 2023
s0undt3ch
s0undt3ch previously approved these changes Apr 8, 2023
@frebib

frebib commented Jul 5, 2023

Copy link
Copy Markdown
Contributor

An interesting thought I had was that it's probably not even necessary to call salt.loader.minion_mods() to update the pillar object- we could simply replace the pillar in the pack and save the overhead of reloading all of the modules

>>> mods = salt.loader.minion_mods(opts, utils=utils)
>>> mods.pack["__pillar__"]
{'foo': 'bar', 'baz': 123}
>>> mods["pillar.get"]("foo")
'bar'
>>> mods["pillar.get"]("baz")
123
>>> mods["pillar.get"]("aaaaaa")
''

>>> opts["pillar"].update({"aaaaaa": 5555})
>>> mods.pack["__pillar__"] = opts["pillar"]
>>> mods["pillar.get"]("aaaaaa")
5555

Comment thread salt/pillar/__init__.py Resolved
@frebib

frebib commented Jul 7, 2023

Copy link
Copy Markdown
Contributor

Yep, I can confirm that with some tweaks this does solve the same problem as my patch, but in a much less shitty way. Thanks @dwoz
I'd love to see this in 3007

@dwoz
dwoz force-pushed the pillarwhilerender branch from 444dc4b to 21c5873 Compare November 8, 2023 22:19
@dwoz dwoz changed the title [master][WIP] Access pillar data while rendering pillars [master] Access pillar data while rendering pillars Nov 8, 2023
@dwoz
dwoz force-pushed the pillarwhilerender branch from 36ef0c3 to 673960b Compare December 6, 2023 22:09
@twangboy

twangboy commented Apr 9, 2024

Copy link
Copy Markdown
Contributor

Looks like the failing tests are valid

twangboy
twangboy previously approved these changes Jul 3, 2025
twangboy
twangboy previously approved these changes Apr 6, 2026
dwoz and others added 22 commits April 12, 2026 02:31
…es, fixed integration regressions, and improved matcher fallback logic
twangboy
twangboy previously approved these changes Apr 14, 2026
sujitdb
sujitdb previously approved these changes Apr 14, 2026

@sujitdb sujitdb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Green CI plus explicit tests for pillar_opts, ssh_merge_pillar, decrypt_pillar, and non-ext_pillar_first paths would increase confidence beyond the new unit test alone.

This branch was previously deployed

1 inactive deployment
ci — 79af1113 Deployed Apr 14, 2026 by dwoz via Build Onedir Packages / macOS (x86_64) #21650
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] access pillar dunder in extension modules during pillar render

6 participants