Skip to content

Fix CLI switches leaking into minion config on Linux - #71

Merged
twangboy merged 4 commits into
saltstack:mainfrom
twangboy:main
Aug 26, 2026
Merged

Fix CLI switches leaking into minion config on Linux#71
twangboy merged 4 commits into
saltstack:mainfrom
twangboy:main

Conversation

@twangboy

Copy link
Copy Markdown
Contributor

What does this PR do?

_fetch_vmtools_salt_minion_conf_guestvars and _fetch_vmtools_salt_minion_conf_tools_conf treated every whitespace-separated token as a key=value pair without checking for '='. When the args guestVar or tools.conf held a raw CLI-style`string (e.g. --minionversion 3007.1 --source <url> --loglevel debug), ``cut -d '='`` returned each token unchanged for both fields, writing bogus self-mapped entries like "--minionversion: --minionversion" to the minion config and breaking the minion.

Skip tokens without '=' (logging a warning) instead of writing them, matching the guard already used by _fetch_vmtools_salt_minion_conf_cli_args and the Windows script's _parse_config. Add the same guard to cli_args for defense in depth.

Add tests/linux/test_minion_conf_parsing.sh to cover the regression.

test_version_resolution.sh and test_minion_conf_parsing.sh existed only as manual-run scripts under tests/linux/, with no CI job exercising them. Add a linux-unit-tests job to the CI template and regenerate ci.yml, so both scripts run on every push/PR touching relevant paths alongside lint.

What issues does this PR fix or reference?

Fixes #70

_fetch_vmtools_salt_minion_conf_guestvars and
_fetch_vmtools_salt_minion_conf_tools_conf treated every
whitespace-separated token as a key=value pair without checking for
'='. When the args guestVar or tools.conf held a raw CLI-style
string (e.g. --minionversion 3007.1 --source <url> --loglevel
debug), cut -d '=' returned each token unchanged for both fields,
writing bogus self-mapped entries like "--minionversion:
--minionversion" to the minion config and breaking the minion.

Skip tokens without '=' (logging a warning) instead of writing them,
matching the guard already used by _fetch_vmtools_salt_minion_conf_cli_args
and the Windows script's _parse_config. Add the same guard to
cli_args for defense in depth.

Add tests/linux/test_minion_conf_parsing.sh to cover the regression.

Fixes saltstack#70
test_version_resolution.sh and test_minion_conf_parsing.sh existed
only as manual-run scripts under tests/linux/, with no CI job
exercising them. Add a linux-unit-tests job to the CI template and
regenerate ci.yml, so both scripts run on every push/PR touching
relevant paths alongside lint.
@twangboy twangboy self-assigned this Aug 26, 2026
max-parallel: 2 throttled the Linux test matrix to 2 jobs at a time,
with no documented reason (in place since the workflow was first
added, no comment or linked issue). GHCR imposes no pull-rate-limit
on public images, and salt/salt already runs 20-30 concurrent CI
jobs, so nothing here requires this cap. Drop it so Linux matches
Windows and runs its full matrix concurrently.
@twangboy
twangboy merged commit d07f263 into saltstack:main Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

switches appended to minion config

1 participant