fix: don't use regex for deb/rpm file matching#8019
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-urisoutput (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/**/CustomDatasnapshot 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. |
Contributor
|
(let's not post internal teams / ICM links within PRs on this repo in the future btw) |
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? |
cameronmeissner
approved these changes
Mar 6, 2026
awesomenix
approved these changes
Mar 6, 2026
janenotjung-hue
pushed a commit
that referenced
this pull request
Mar 11, 2026
saewoni
pushed a commit
that referenced
this pull request
Mar 20, 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 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 #