fix(sos): refactor Azure IMDS collection with pretty-printed JSON#17345
fix(sos): refactor Azure IMDS collection with pretty-printed JSON#17345jonathanbrenes wants to merge 1 commit into
Conversation
Backport upstream PR sosreport/sos#4322 (merged) to the AZL sos 4.11.0 build. Replaces the curl-based IMDS collection with a Python urllib approach that emits pretty-printed JSON, bumps the IMDS API version from 2023-07-01 to 2025-04-07, and collects the full /metadata/instance payload (now including network info). Signed-off-by: Jonathan Brenes <jonathan.brenes@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Backports upstream sosreport/sos#4322 to the Azure Linux sos 4.11.0 build, replacing the curl-based Azure IMDS metadata collection with a Python urllib implementation that emits pretty-printed JSON, bumps the IMDS API version to 2025-04-07, and collects the full /metadata/instance payload.
Changes:
- Add backport patch
azure-refactor-IMDS-collection-with-pretty-printed-JSON.patchunderbase/comps/sos/. - Wire the patch into
sos.comp.tomlvia apatch-addoverlay. - Refresh
locks/sos.lockand re-renderspecs/s/sos/sos.spec(Release bumped to 4.11.0-6).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| base/comps/sos/azure-refactor-IMDS-collection-with-pretty-printed-JSON.patch | New backport patch source. |
| base/comps/sos/sos.comp.toml | Adds patch-add overlay for the new patch. |
| locks/sos.lock | Updated input-fingerprint after overlay change. |
| specs/s/sos/sos.spec | Re-rendered: Patch4 registered, Release bumped to 6, changelog entry added. |
| specs/s/sos/azure-refactor-IMDS-collection-with-pretty-printed-JSON.patch | Patch file copied into rendered specs dir. |
ddstreetmicrosoft
left a comment
There was a problem hiding this comment.
this seems fine, but it's something that should be deferred to after our beta release; marking this as 'request changes' only to block it getting merged until after beta.
That sounds fine. We just want to make sure to have as much information as possible when we may receive cases about AZL4 for troubleshooting |
Backport upstream PR sosreport/sos#4322 (merged) to the AZL sos 4.11.0 build.
Replaces the curl-based IMDS collection with a Python urllib approach that emits pretty-printed JSON, bumps the IMDS API version from 2023-07-01 to 2025-04-07, and collects the full /metadata/instance payload (now including network info).
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-staticsubpackages, etc.) have had theirReleasetag incremented.*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
Backports upstream sosreport/sos#4322 (merged) into the Azure Linux
sos4.11.0 build. The Azure plugin's IMDS metadata collection now uses Pythonurllibinstead of shelling out tocurl, producing pretty-printed JSON (4-space indented) for improved readability in the sos report. The IMDS API version is bumped to the latest supported (2025-04-07), and the collected payload is the full/metadata/instance(which now includes network information) instead of only/metadata/instance/compute.Change Log
azure-refactor-IMDS-collection-with-pretty-printed-JSON.patchto thesoscomponent, backporting upstream PR [azure] Refactor IMDS collection with pretty-printed JSON sosreport/sos#4322 to sos 4.11.0 (Fedora 43 dist-git base, which does notimport glob— hunk 1 line numbers adjusted accordingly).base/comps/sos/sos.comp.tomlas apatch-addoverlay.locks/sos.lockand re-renderspecs/s/sos/sos.spec(Release bumped to4.11.0-6).Affected package:
sos.Does this affect the toolchain?
NO
Associated issues
Links to CVEs
Test Methodology
azldev comp build -p sosagainsttomls/base/main(builtsos-4.11.0-6.azl4.noarch.rpm).azldev adv mock shell --add-package …) verified:from sos.report.plugins.azure import Azure, IMDS_URLimports cleanly.IMDS_URL == "http://169.254.169.254/metadata/instance?api-version=2025-04-07&format=json".Azure.collectandAzure._get_imds_metadataare present and callable.azldev comp render -p sosandazldev comp update -p sosboth clean after the finalize-and-amend step (no drift).