[BUG] Salt-proxy module __pillar__ and opts["pillar"] not refreshed on saltutil.refresh_pillar #58197
Labels
Bug
broken, incorrect, or confusing behavior
Proxy-Minion
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
Salt-proxy module in-memory pillar dunder
__pillar__
andopts["pillar"]
not refreshed onsaltutil.refresh_pillar
call.That is true for both
multiprocessing
set toTrue
orFalse
Setup
Setup dummy proxy in base env
https://github.com/saltstack/salt/blob/master/salt/proxy/dummy.py
Add these two functions to dummy.py salt-proxy:
And created this execution module:
[salt://_modules/dummy.py]
Steps to Reproduce the behavior
Run salt-proxy dummy module, update pillar data, run
salt dummy-proxy-id saltutil.refresh_pillar
, after that run and compare output from these commands:to observe that (1) returns updated pillar info while 2 and 3 pillar data remains the same. The only way to update salt-proxy pillar data is to restart the process.
Expected behavior
Expected behavior described here:
https://docs.saltstack.com/en/latest/topics/pillar/index.html#pillar-in-memory
namely:
... the in-memory pillar data is available as the
__pillar__
dunder dictionary.The in-memory pillar data is generated on minion start, and can be refreshed using the
saltutil.refresh_pillar
functionVersions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Using
__salt__['pillar.items']()
as a workaround to get latest pillar data from master works, but seems to me as a less optimal solution compared to updatingopt["pillar"]
or__pillar__
dunder onsaltutil.refresh_pillar
call.Did some debugging and was able to get expected behavior by appending this line:
salt/salt/minion.py
Line 2430 in c5ea361
with this block of code:
While that works, not sure that this is the most optinal way of doing it, and not sure that this is actually should be done at all, as it seems to me that being able to refresh pillar data for minion is a basic functionality and that problem should be cought long ago, unless it is expected that salt-proxy minion pillar data should not be update on
saltutil.refresh_pillar
call.Please advise.
The text was updated successfully, but these errors were encountered: