Repository navigation
fix(bootstrap): keep a point release salt.repo on its major version - #2148
Merged
Merged
Conversation
For a point release such as "stable 3006.26", the RPM repository functions write their own salt.repo section instead of using the official one. Its baseurl (saltproject-rpm/) serves every major and the section had no exclude= line, so the requested version was installed but the first "dnf update" moved the host to the newest Salt in the repo (3008.3 when this was reported). With "stable 3006" the official salt.repo and the sections written for Amazon Linux already exclude the other majors. Add __salt_repo_exclude_majors, which prints the same exclude list the official salt.repo uses (3006 through 3010 minus the requested major, extended to two majors past it for 3009 and later), and write it into the point release section for RHEL and its rebuilds, Fedora, and Amazon Linux 2 and 2023. As with a major version, updates still move to the latest release of the same major. The Amazon Linux 2 git deps function gets the same line to match, although no install type reaches its point release branch today. Photon OS is left alone: tdnf does not read exclude= from a .repo file, so the line would have no effect there. SUSE already adds zypper locks for the major and is unchanged. Tests: - ShellSpec: the helper output for several versions, and the salt.repo written by the RHEL and Fedora functions for a point release. - Integration: a salt.repo section written for a point release must exclude every other major, skipped on Photon OS. CI installs 3006.24 and 3007.1 on Rocky Linux 8 and 9 and Amazon Linux 2023. Fixes saltstack#2147
twangboy
force-pushed
the
fix-point-release-major-pin
branch
from
October 26, 2026 19:14
a6507ed to
5dc40a6
Compare
twangboy
approved these changes
Oct 29, 2026
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?
For a point release (e.g.
stable 3006.26) the RPM repo functions write their own salt.repo section withbaseurl=.../saltproject-rpm/, which serves every major, and noexclude=. This adds__salt_repo_exclude_majorsand writes its output as anexclude=line in that section, with the same list as the official salt.repo (3006 through 3010 minus the requested major; from 3009 on it also covers the next two majors). It goes in the "using minor version" branch of:__install_saltstack_rhel_onedir_repository__install_saltstack_fedora_onedir_repositoryinstall_amazon_linux_ami_2_onedir_depsinstall_amazon_linux_ami_2023_onedir_depsinstall_amazon_linux_ami_2_deps(git deps; to match, although no install type reaches its point release branch today)Photon OS is left alone: tdnf doesn't read
exclude=from a .repo file, so the line would do nothing there, and itsstable 3006section doesn't hold the major today either. SUSE already uses zypper locks and isn't touched. The section name and "LTS" label are unchanged.I used
exclude=rather than enabling one section of the official salt.repo, because that relies onconfig-manager --set-disable/--set-enabled, which failed in my tests on Fedora 44 (dnf5) and on the rockylinux:9 image (no dnf-plugins-core) and left the 3008 section enabled even forstable 3006. That's a separate problem and isn't changed here.Tests: ShellSpec specs for the helper and for the section written by the RHEL and Fedora functions, and an integration test that a point release section excludes the other majors (skipped on Photon OS). CI already runs
stable 3006.24andstable 3007.1on Rocky Linux 8/9 and Amazon Linux 2023.Tested in podman containers with
bootstrap-salt.sh -X -D stable <ver>and thendnf/yum update 'salt*':stable 3006.26: updates to 3008.3 on AlmaLinux 10.2, Rocky Linux 9.8, Fedora 44, Amazon Linux 2 and 2023.stable 3006.26: updates to 3006.28 on AlmaLinux 10.2, Rocky Linux 9.8, Oracle Linux 9.8, CentOS Stream 10, Fedora 44 and 45 beta, Amazon Linux 2 and 2023.stable 3007.14updates to 3007.15 andstable 3008.2to 3008.3.stable 3006behaves the same on both.What issues does this PR fix or reference?
Fixes #2147
Previous Behavior
bootstrap-salt.sh stable 3006.26installed 3006.26, but the generated section had no exclude, so the firstdnf updatemoved the host to the newest Salt in the repo (3008.3). CI on develop shows it too: in Rocky Linux 9 / stable-3006-24yum list salt-minionoffers3008.3-0fromsalt-repo-3006.24-lts.New Behavior
The generated section has
exclude=*3007* *3008* *3009* *3010*for a 3006.x pin (and the matching list for other majors), so with yum and dnf updates stay on the requested major, as with the 3006-lts section of the official salt.repo. Exact pins still need versionlock, as the install guide describes. Photon OS is unchanged.