Skip to content

Commit 28bd20a

Browse files
committed
Fix GitCLI environment filtering and cleanup duplication
- Consolidated duplicated GitCLI class implementations into a single cohesive class. - Fixed environment filtering in envs() to correctly re-initialize config attributes (ref_types, disable_saltenv_mapping) from the instance, ensuring global and per-remote overrides are respected. - Added missing threading import in salt/utils/gitfs.py. - Cleaned up unnecessary pass statement in setup_callbacks to satisfy pylint.
1 parent f22f5df commit 28bd20a

11 files changed

Lines changed: 234 additions & 181 deletions

File tree

agents/docs/architecture.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ Salt includes a file server that serves files to minions:
158158
- Multiple backends: local, git, S3, HTTP, etc.
159159
- Files are cached on minions
160160

161+
For details on the Git backends and performance, see [GitFS Providers](gitfs-providers.md).
162+
161163
## Targeting
162164

163165
Minions can be targeted in multiple ways:

salt/config/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,9 @@ def _gather_buffer_space():
11821182
"git_pillar_refspecs": _DFLT_REFSPECS,
11831183
"git_pillar_includes": True,
11841184
"git_pillar_proxy": "",
1185+
"git_pillar_depth": 1,
1186+
"git_pillar_ref_types": ["branch", "tag", "sha"],
1187+
"git_pillar_disable_saltenv_mapping": False,
11851188
"gitfs_remotes": [],
11861189
"gitfs_mountpoint": "",
11871190
"gitfs_root": "",
@@ -1202,6 +1205,7 @@ def _gather_buffer_space():
12021205
"gitfs_refspecs": _DFLT_REFSPECS,
12031206
"gitfs_disable_saltenv_mapping": False,
12041207
"gitfs_proxy": "",
1208+
"gitfs_depth": 1,
12051209
"unique_jid": False,
12061210
"hash_type": DEFAULT_HASH_TYPE,
12071211
"optimization_order": [0, 1, 2],
@@ -1308,6 +1312,7 @@ def _gather_buffer_space():
13081312
"winrepo_pubkey": "",
13091313
"winrepo_passphrase": "",
13101314
"winrepo_refspecs": _DFLT_REFSPECS,
1315+
"winrepo_depth": 1,
13111316
"pidfile": os.path.join(salt.syspaths.PIDFILE_DIR, "salt-minion.pid"),
13121317
"range_server": "range:80",
13131318
"reactor_refresh_interval": 60,
@@ -1451,6 +1456,9 @@ def _gather_buffer_space():
14511456
"git_pillar_includes": True,
14521457
"git_pillar_verify_config": True,
14531458
"git_pillar_proxy": "",
1459+
"git_pillar_depth": 1,
1460+
"git_pillar_ref_types": ["branch", "tag", "sha"],
1461+
"git_pillar_disable_saltenv_mapping": False,
14541462
"gitfs_remotes": [],
14551463
"gitfs_mountpoint": "",
14561464
"gitfs_root": "",
@@ -1471,6 +1479,7 @@ def _gather_buffer_space():
14711479
"gitfs_refspecs": _DFLT_REFSPECS,
14721480
"gitfs_disable_saltenv_mapping": False,
14731481
"gitfs_proxy": "",
1482+
"gitfs_depth": 1,
14741483
"hgfs_remotes": [],
14751484
"hgfs_mountpoint": "",
14761485
"hgfs_root": "",
@@ -1649,6 +1658,7 @@ def _gather_buffer_space():
16491658
"winrepo_pubkey": "",
16501659
"winrepo_passphrase": "",
16511660
"winrepo_refspecs": _DFLT_REFSPECS,
1661+
"winrepo_depth": 1,
16521662
"syndic_wait": 5,
16531663
"jinja_env": {},
16541664
"jinja_sls_env": {},

salt/fileserver/gitfs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"ref_types",
6666
"update_interval",
6767
"proxy",
68+
"depth",
6869
)
6970
PER_REMOTE_ONLY = ("all_saltenvs", "name", "saltenv")
7071

salt/pillar/git_pillar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@
406406
"refspecs",
407407
"fallback",
408408
"proxy",
409+
"ref_types",
410+
"disable_saltenv_mapping",
411+
"depth",
409412
)
410413
PER_REMOTE_ONLY = ("name", "mountpoint", "all_saltenvs")
411414
GLOBAL_ONLY = ("branch",)

0 commit comments

Comments
 (0)