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] jinja sls variables like sls, slspath, tpldir are not loaded for saltcheck.run_state_tests #66653

Open
amalaguti opened this issue Jun 21, 2024 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@amalaguti
Copy link

Description
SLS Jinja variables described here
https://docs.saltproject.io/en/latest/ref/states/vars.html
are not available in the context for saltcheck.run_state_tests

At least the following ones do not seem to be resolved properly for saltcheck states
{{ tpldir }}
{{ slspath }}
{{ sls }}

Setup
Trying to use these variables to import a jinja map file that provides settings to be used in the saltcheck state.

{%- set tplroot = tpldir.split('/')[0] %}
{% from tplroot ~ "/map.jinja" import settings with context %}

The jinja template is not found due the variables return none.

A hardcoded string works fine

{% from"path_to_state/map.jinja" import settings with context %}

Steps to Reproduce the behavior
Create a jinja map file and a saltcheck state to use it, try importing the jinja map file using tpldir or slspath variables

Expected behavior
These variables should be loaded in a similar way than it's done for state.sls

@amalaguti amalaguti added Bug broken, incorrect, or confusing behavior needs-triage labels Jun 21, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant