-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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] Unable to use saltcheck with a map.jinja #57327
Comments
@mchugh19 Any insights you could offer on this one? |
@garethgreenaway map files should be supported. There was a conversation about how best to handle this in #53024. It really comes down to the saltcheck running files through the renderer, and figuring out what's needed, then caching that. Map files were very much tested, so I'd expect this to work, but I don't see map files included in the integration test. |
I just tried to replicate by cloning the ntp formula and copied the ntp directory to /srv/salt. I then added ntp/saltcheck-tests/init.tst with the content:
As you can see, this test uses the formula's map.jinja file. I am then able to run saltcheck with this test:
It also works with master/minion
Thus, my testing seems to show that map.jinja files are rendered just fine, and I'm not able to replicate. The reported error makes it seem that the file doesn't actually exist
@pgporada Can you double check the filename and paths? Or is there any special about your testcase that I didn't replicate like gitfs or salt-ssh? |
I've also tried to replicate with the given whatever files:
whatever/map.jinja - Note updated for my test host of Debian-10
whatever/whatever.sls
whatever/saltcheck-tests/whatever.tst
whatever/defaults.yml
Given this file structure, I am able to display the map.jinja contents:
So I can validate that the map.jinja is being successfully rendered. Then I'm able to run saltcheck for the given state
|
It appears that importing map.jinja from saltcheck-tests, doesn't honor saltenv.
Here is the directory structure.
I am able to run However, when I run
However, if i change the the file_root for dev to point to /srv/salt/dev and move my test state directory to /srv/salt/dev/grub:
AND I change the saltcheck-test/init.tst jinja import from the base:
Everything works as expected
Here is my versions-report
|
Thanks for the info @cingeyedog I just pushed a fix for this in #57557. Sodium is already in a release freeze, so this is unlikely to make it in time, but you get the fixed version from that PR and place it into your salt states/_modules directory (and run saltutl.sync_all) to correct your existing setup. It's a one line fix, and the saltcheck file itself should be able to be backported to any older release of salt. |
Thank you @mchugh19 Verified the fix provided resolved the issue. |
I can confirm that this fixed my problem too. |
Description
Setup
The map.jinja contains
The whatever.tst file contains
Expected behavior
I should be able to use the
map.jinja
from a formula in a saltcheck test.Versions Report
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: