Skip to content

fix: don't use regex for deb/rpm file matching#8019

Merged
lilypan26 merged 7 commits intomainfrom
lily/fix-pmc-filename-matching
Mar 6, 2026
Merged

fix: don't use regex for deb/rpm file matching#8019
lilypan26 merged 7 commits intomainfrom
lily/fix-pmc-filename-matching

Conversation

@lilypan26
Copy link
Copy Markdown
Contributor

@lilypan26 lilypan26 commented Mar 4, 2026

What this PR does / why we need it:
Avoids using regex to match downloaded rpm/deb filename. Previous implementation led to provisioning failures when upstream made changes to PMC file naming format by adding hash prefix to expected file name.

Which issue(s) this PR fixes:

Fixes #

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make deb/rpm cached file selection more robust by using package/repo metadata-derived filenames instead of filename-format regex matching, and regenerates the CustomData snapshot test fixtures accordingly.

Changes:

  • Ubuntu: switch deb cache lookup toward apt-get download --print-uris output (filename) instead of a globbed prefix.
  • Azure Linux/Mariner: switch rpm cache lookup toward dnf repoquery --location (filename) instead of a globbed pattern.
  • Regenerate multiple pkg/agent/testdata/**/CustomData snapshot blobs.

Reviewed changes

Copilot reviewed 62 out of 62 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Updates deb cache matching logic to use an apt-derived filename rather than a version prefix glob.
parts/linux/cloud-init/artifacts/mariner/cse_install_mariner.sh Updates rpm cache matching logic to use a repoquery-derived filename rather than a version prefix glob.
parts/linux/cloud-init/artifacts/azlosguard/cse_install_osguard.sh Attempts to update OSGuard rpm cache matching similarly (but currently introduces ordering/tooling issues).
pkg/agent/testdata/CustomizedImageLinuxGuard/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/CustomizedImageKata/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/CustomizedImage/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2404+Teleport/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2404+NetworkPolicy/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2204+ootcredentialprovider/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2204+cgroupv2/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2204+SecurityProfile/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2204+SSHStatusOn/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2204+CustomCloud/CustomData Snapshot regeneration to reflect new provisioning output.
pkg/agent/testdata/AKSUbuntu2204+China/CustomData Snapshot regeneration to reflect new provisioning output.

Comment thread parts/linux/cloud-init/artifacts/azlosguard/cse_install_osguard.sh
Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Outdated
Comment thread parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh Outdated
Comment thread parts/linux/cloud-init/artifacts/mariner/cse_install_mariner.sh Outdated
Comment thread parts/linux/cloud-init/artifacts/azlosguard/cse_install_osguard.sh
Copilot AI review requested due to automatic review settings March 5, 2026 19:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@cameronmeissner
Copy link
Copy Markdown
Contributor

(let's not post internal teams / ICM links within PRs on this repo in the future btw)

@cameronmeissner
Copy link
Copy Markdown
Contributor

just to clarify, it seems we don't need to update any logic for flatcar/ACL since those are using sysexts rather than RPMs?

@lilypan26 lilypan26 merged commit e47b9c8 into main Mar 6, 2026
27 of 31 checks passed
@lilypan26 lilypan26 deleted the lily/fix-pmc-filename-matching branch March 6, 2026 19:00
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.

4 participants