saltstack / saltstack/salt

[BUG] pillar system does not find foo/init.sls when foo.sls exists on a different git_pillar repo

Open
#65,580 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage Pillar
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
With two different pillar_roots (both git_pillar), both have pillar matches that call for foo to be included in pillar for specific minions
Example:

main:
    '*.db.mydomain.com'
        - foo

In one git_pillar repo, foo.sls exists. In the other repo, foo/init.sls exists.

In this situation, the pillar data from foo/init.sls never makes it to the minion.

Renaming foo/init.sls to foo.sls on the second repo fixes the problem.

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior

  1. Setup two different git_pillar repos
  2. Create foo.sls in one repo, and foo/init.sls in the other repo, make them have different data inside
  3. In both top.sls files, make a match for the minion and call out - foo as the data
  4. Make pillar.items calls to matching minions
  5. Observe that data from foo/init.sls does not make it into the minion's pillar data
  6. Rename foo/init.sls to foo.sls in the second repo
  7. Observe that subsequent pillar.items calls now show the missing data

Expected behavior
When - foo is called out in the pillar top.sls, then foo/init.sls and foo.sls should be read if they exist in the pillarenv, and the existence of one of them in one pillar repo should not block the other in a different repo

Versions Report
3006.3

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two git_pillar repository setup with matching top.sls entries and compare pillar.items output before and after renaming foo/init.sls to foo.sls. Trace how the pillar top.sls request for foo resolves files across the pillarenv, then verify that both foo.sls and foo/init.sls contribute data without one repository blocking the other.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.