Repository navigation
Description
Description
This option has no default value. Set it to an environment name to ensure that only the top file from that environment is considered during a highstate.
The docs here are wrong. The "ensure that only the top file from that environment is considered" is only applicable if saltenv is not specified by the minion.
Lines 3892 to 3920 in 29b6843
| if self.opts["saltenv"]: | |
| contents = self.client.cache_file( | |
| self.opts["state_top"], self.opts["saltenv"] | |
| ) | |
| if contents: | |
| found = 1 | |
| tops[self.opts["saltenv"]] = [ | |
| compile_template( | |
| contents, | |
| self.state.rend, | |
| self.state.opts["renderer"], | |
| self.state.opts["renderer_blacklist"], | |
| self.state.opts["renderer_whitelist"], | |
| saltenv=self.opts["saltenv"], | |
| context=context, | |
| ) | |
| ] | |
| else: | |
| tops[self.opts["saltenv"]] = [{}] | |
| else: | |
| found = 0 | |
| state_top_saltenv = self.opts.get("state_top_saltenv", False) | |
| if state_top_saltenv and not isinstance(state_top_saltenv, str): | |
| state_top_saltenv = str(state_top_saltenv) | |
| for saltenv in ( | |
| [state_top_saltenv] if state_top_saltenv else self._get_envs() | |
| ): |
Suggested Fix
Update the docs to indicate that it will only apply if the minion does not have a saltenv configured. I believe this setting is more accurately described as a saltenv fallback, as it behaves very similar to if saltenv was configured.
Location or format of documentation
https://docs.saltproject.io/en/latest/ref/configuration/master.html#state-top-saltenv
https://docs.saltproject.io/en/latest/ref/configuration/minion.html#state-top-saltenv
Additional context
I actually like the way the option currently works. I do /not/ believe it should be changed.
Activity
dwoz commentedon Oct 28, 2026
Closing — consolidated into #70585. The checkbox for this item is in the appropriate theme section of that tracker. Please pick up the sub-item there.