-
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
Add "none" as a pillar merging strategy #36435
Changes from 7 commits
c0a4992
1809917
6becc0d
f43a1ab
d5d5a85
6239384
e598817
1f35478
ded8ad4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2791,6 +2791,9 @@ Default: ``smart`` | |
The pillar_source_merging_strategy option allows you to configure merging | ||
strategy between different sources. It accepts 4 values: | ||
|
||
* ``none``: | ||
it will not do any merging at all and only parse the pillar data from the passed environment and 'base' if no environment was specified. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please capitalize the first word in this sentence? |
||
|
||
* ``recurse``: | ||
|
||
it will merge recursively mapping of data. For example, theses 2 sources: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,6 +265,7 @@ def __init__(self, opts, grains, minion_id, saltenv, ext=None, functions=None, | |
self.actual_file_roots = opts['file_roots'] | ||
# use the local file client | ||
self.opts = self.__gen_opts(opts, grains, saltenv=saltenv, ext=ext, pillarenv=pillarenv) | ||
self.saltenv = saltenv | ||
self.client = salt.fileclient.get_file_client(self.opts, True) | ||
|
||
if opts.get('file_client', '') == 'local': | ||
|
@@ -378,6 +379,11 @@ def get_tops(self): | |
] | ||
else: | ||
for saltenv in self._get_envs(): | ||
if self.opts.get('pillar_source_merging_strategy', None) == "none": | ||
if self.saltenv and saltenv != self.saltenv: | ||
continue | ||
if not self.saltenv and not saltenv == 'base': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically we'd like to see these conditionals combined but here I think it enhances readability. Good call. 👍 |
||
continue | ||
top = self.client.cache_file( | ||
self.opts['state_top'], | ||
saltenv | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, you don't need to edit the man pages. They are automatically rebuilt on each release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted:)