[BUG] all_saltenvs is ignored by disable_saltenv_mapping
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
When using formulas, for example, you usually want all of your saltenvs to use the same version of the formula, but it's also good to reduce the number of saltenvs that are automatically detected but will never be used. It appears that this should be possible, but it doesn't work well, as all_saltenvs doesn't count as "per-saltenv configuration parameters".
Setup
gitfs_remotes:
- https://github.com/saltstack-formulas/apt-formula:
- all_saltenvs: v0.10.2
- disable_saltenv_mapping: true
- https://github.com/private/saltstack:
- root: salt
Steps to Reproduce the behavior
Attempt to apply a state that uses the formula
Expected behavior
Regardless of the applied saltenv (base, prod, 'test`, etc.), it should use the git tag as configured for the formula.
Instead there are no mappings at all.
Versions Report
salt --versions-report
Salt Version:
Salt: 3004
Dependency Versions:
cffi: 1.14.5
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: 2.0.6
gitpython: 3.0.7
Jinja2: 2.10.1
libgit2: 1.3.0
M2Crypto: 0.31.0
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.20
pycrypto: Not Installed
pycryptodome: 3.6.1
pygit2: 1.7.1
Python: 3.8.10 (default, Nov 26 2021, 20:14:08)
python-gnupg: 0.4.5
PyYAML: 5.3.1
PyZMQ: 18.1.1
smmap: 2.0.5
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.2
System Versions:
dist: ubuntu 20.04 focal
locale: utf-8
machine: x86_64
release: 5.4.0-96-generic
system: Linux
version: Ubuntu 20.04 focal
Additional context
If you want to increase performance with disable_saltenv_mapping then you have to map every single saltenv manually, and change it whenever a new one is added.
gitfs_remotes:
- https://github.com/saltstack-formulas/apt-formula:
- base: v0.10.2
- saltenv:
- prod:
- ref: v0.10.2
- test:
- ref: v0.10.2
- pre-release:
- ref: v0.10.2
# ...
- disable_saltenv_mapping: true
- https://github.com/private/saltstack:
- root: salt
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided gitfs_remotes configuration with all_saltenvs and disable_saltenv_mapping enabled, then trace how those parameters are handled for the base, prod, and test saltenvs. Done means the configured git tag is used for every applied saltenv without manually adding mappings, while unrelated remotes continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100