Skip to content

fix(bootstrap): keep a point release salt.repo on its major version - #2148

Merged
twangboy merged 1 commit into
saltstack:developfrom
ggiesen:fix-point-release-major-pin
Oct 29, 2026
Merged

twangboy merged 1 commit into
saltstack:developfrom
ggiesen:fix-point-release-major-pin

Conversation

@ggiesen

@ggiesen ggiesen commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

For a point release (e.g. stable 3006.26) the RPM repo functions write their own salt.repo section with baseurl=.../saltproject-rpm/, which serves every major, and no exclude=. This adds __salt_repo_exclude_majors and writes its output as an exclude= 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_repository
  • install_amazon_linux_ami_2_onedir_deps
  • install_amazon_linux_ami_2023_onedir_deps
  • install_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 its stable 3006 section 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 on config-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 for stable 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.24 and stable 3007.1 on Rocky Linux 8/9 and Amazon Linux 2023.

Tested in podman containers with bootstrap-salt.sh -X -D stable <ver> and then dnf/yum update 'salt*':

  • develop, stable 3006.26: updates to 3008.3 on AlmaLinux 10.2, Rocky Linux 9.8, Fedora 44, Amazon Linux 2 and 2023.
  • this branch, 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.14 updates to 3007.15 and stable 3008.2 to 3008.3.
  • stable 3006 behaves the same on both.
  • Photon OS 5.0 and 4.0 (tdnf 3.6.5 and 3.3.12) updated to 3008.3 even with the exclude line, which is why it's not changed.
  • ShellSpec (dash and bash) and shellcheck pass; the new specs fail against develop.

What issues does this PR fix or reference?

Fixes #2147

Previous Behavior

bootstrap-salt.sh stable 3006.26 installed 3006.26, but the generated section had no exclude, so the first dnf update moved the host to the newest Salt in the repo (3008.3). CI on develop shows it too: in Rocky Linux 9 / stable-3006-24 yum list salt-minion offers 3008.3-0 from salt-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.

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
twangboy force-pushed the fix-point-release-major-pin branch from a6507ed to 5dc40a6 Compare October 26, 2026 19:14
@twangboy
twangboy merged commit aa080cd into saltstack:develop Oct 29, 2026
165 checks passed
@twangboy twangboy self-assigned this Oct 29, 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.

Point release on RPM distros (e.g. stable 3006.26) writes a salt.repo with no major limit; dnf update installs 3008.3

2 participants