Skip to content

cdi: add resolved edits API - #322

Open
ebendler wants to merge 1 commit into
cncf-tags:mainfrom
ebendler:edits_api
Open

cdi: add resolved edits API#322
ebendler wants to merge 1 commit into
cncf-tags:mainfrom
ebendler:edits_api

Conversation

@ebendler

Copy link
Copy Markdown

The idea here is that some CDI consumers may not be operating on an OCI container (think sandbox wrappers), but it would be silly to have them all re-implement the code that maps the specfile to the running host when the reference implementations are already doing all of that work.

See also: cncf-tags/container-device-interface-rs#101

@zvonkok
zvonkok requested review from Copilot and klihub and removed request for klihub July 15, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread pkg/cdi/resolved-edits.go Outdated
Comment thread pkg/cdi/resolved-edits.go Outdated
@ebendler

Copy link
Copy Markdown
Author

Thanks, @klihub — your comments made the result API clearer. I’ve updated the resolved device-node and mount outputs to embed the effective CDI types with scope metadata, and added coverage for the FIFO zero-value convention.

Comment thread pkg/cdi/resolved-edits.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread pkg/cdi/cache.go
Comment thread pkg/cdi/cache.go
Comment thread pkg/cdi/cache.go Outdated
Comment thread pkg/cdi/cache.go Outdated
Signed-off-by: Ehren Bendler <ebendler@nvidia.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


// cloneContainerEdits returns a deep copy of edits that can be safely modified
// without changing the source CDI Spec.
func cloneContainerEdits(edits *ContainerEdits) (*ContainerEdits, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: why not func (edits *ContainerEdits) Clone() (*ContainerEdits, error) ?

Comment thread pkg/cdi/cache.go
// any of the devices. Might trigger a cache refresh, in which case any
// errors encountered can be obtained using GetErrors().
func (c *Cache) InjectDevices(ociSpec *oci.Spec, devices ...string) ([]string, error) {
var unresolved []string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will conflict with #345, so if we're to take both in we should co-ordinate and rebase either one on the other. Due to their nature, I think it'll be easier to take #345 in first, then rebase this one.

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.

5 participants