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
"top_file_merging_strategy: same" is functionally identical to specifying an environment #35045
Comments
@GarthSnyder I am also seeing the same behavior in 2016.3.1. Given my understanding, with teh following test case:
I would expect it to look like:
I have to specify the |
ping @terminalmage am I understanding the usage of same merging strategy? From the docs here I would expect it to work differently then it is. Just wanted to double check that I understand it correctly and accurately labeled this as a bug. Thanks |
@Ch3LL Sorry about the lack of response, I should be able to look into this on Tuesday or Wednesday. |
Working on a fix this morning. |
We'll need to make sure we do docs here based on the strategy that tom and erik outlined |
+1, encountered this issue myself. When I specify |
This is fixed in #35822. @thatch45 and I discussed this and decided that changes in top file merging should not be made in a point release, so this fix is going into the develop branch and will be part of the #35744 was opened yesterday to add corrective information to the docs regarding top file merging behavior, and to let users know that the behavior is slated to be fixed in the Carbon release. |
[Please see also #34975. You'll need to set
top_file_merging_strategy: same
on the master to see this effect, as this option currently has no effect on a minion.]The docs for
top_file_merging_strategy
say "...When set tosame
, then for each environment, only that environment's top file is processed, with the others being ignored. For example, only thedev
environment's top file will be processed for thedev
environment, and any SLS targets defined fordev
in thebase
environment's (or any other environment's) top file will be ignored. If an environment does not have a top file, then the top file from thedefault_top
config parameter will be used as a fallback."That doesn't appear to be true; the
default_top
is applied in all cases when the minion doesn't specify anenvironment
of its own, regardless of whether a corresponding top file exists on the master.See the following code within
__get_tops()
insalt/state.py
:The effect is that under
top_file_merging_strategy: same
, a minion always has a pinnedenvironment
. The effects of specifying an environment are more restrictive than just those documented fortop_file_merging_strategy: same
. Only the pinned environment's top file will be read, and only the section matching the environment will be seen by the minion.I'm not sure whether the issue is with the documentation or with the code, but as it stands now, there does not seem to be any difference between
top_file_merging_strategy: same
andenvironment: base
. The code and documentation fortop_file_merging_strategy
anddefault_top
could simply be dropped without loss of generality.As an example, consider the following set of environment trees:
Each state file is named after the referencing environment + the referenced environment. For example,
dev/salt/proddev.sls
is a state mentioned only in thedev
section ofprod/salt/top.sls
.base/salt/top.sls
contains:I used slightly different matching patterns in each top file so they wouldn't collide, but otherwise the general layout is the same for all of them.
With this configuration and the client set to
top_file_merging_strategy: same
, I would expect the following highstate:The actual highstate is:
$ sudo salt '*' test.versions_report
hoecackle:
Salt Version:
Salt: 2016.3.1-147-gf23e8c5
The text was updated successfully, but these errors were encountered: