Skip to content

info: report configured and discovered CDI devices#28712

Open
elezar wants to merge 3 commits into
podman-container-tools:mainfrom
elezar:info-cdi-devices
Open

info: report configured and discovered CDI devices#28712
elezar wants to merge 3 commits into
podman-container-tools:mainfrom
elezar:info-cdi-devices

Conversation

@elezar
Copy link
Copy Markdown
Contributor

@elezar elezar commented May 15, 2026

Add CDI information to podman info and podman system info.

The host info now includes the configured CDI spec directories and the currently discovered CDI devices. The devices are resolved when the info endpoint is called and there is no need to refresh these in the background.

Also map the same data into the Docker-compatible /info response as CDISpecDirs and DiscoveredDevices.

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

Add CDI spec dirs and discovered CDI devices to `/info` endpoint and `podman info` output.

@github-actions github-actions Bot added the kind/api-change Change to remote API; merits scrutiny label May 15, 2026
@packit-as-a-service
Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Comment thread libpod/info.go
Comment thread test/e2e/info_test.go Outdated
Comment thread test/e2e/info_test.go Outdated
Add CDI information to podman info and podman system info.

The host info now includes the configured CDI spec directories and the
currently discovered CDI devices. The devices are resolved when the info
endpoint is called and there is no need to refresh these in the background.

Also map the same data into the Docker-compatible /info response as CDISpecDirs and DiscoveredDevices.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar force-pushed the info-cdi-devices branch from 78c437b to e740848 Compare June 1, 2026 19:45
elezar added 2 commits June 1, 2026 21:52
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar requested a review from Honny1 June 1, 2026 19:57
Copy link
Copy Markdown
Contributor

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@podman-container-tools/podman-maintainers PTAL

Comment thread test/system/005-info.bats
}
EOF

run_podman --cdi-spec-dir "$cdi_dir" info --format=json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this not essentially the same test as in e2e except that this one uses --cdi-spec-dir while the e2e one uses the config file?

personally I like to avoid test duplication between the two as it just adds unnecessary CI time, our tests are already slow

Feels like it would be simpler to just add this into the e2e test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this change is probably not strictly required since we're not checking anything other than the json content reported by the info command.

My one naive question would be how this is different to the other tests that are also added here?

(Happy to remove this if you feel strongly about it though).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also, I don't think the --cdi-spec-dir flag is in common use, and if I recall correctly it was mainly added for testing flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change Change to remote API; merits scrutiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants