Fix CLI switches leaking into minion config on Linux - #71
Merged
Conversation
_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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
_fetch_vmtools_salt_minion_conf_guestvarsand_fetch_vmtools_salt_minion_conf_tools_conftreated every whitespace-separated token as akey=valuepair 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_argsand the Windows script's_parse_config. Add the same guard to cli_args for defense in depth.Add
tests/linux/test_minion_conf_parsing.shto cover the regression.test_version_resolution.shandtest_minion_conf_parsing.shexisted only as manual-run scripts undertests/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