Skip to content

Return a wrapped fs.ErrNotExist if no spec directories are defined#309

Open
elezar wants to merge 1 commit intocncf-tags:mainfrom
elezar:return-fs-err-no-exits
Open

Return a wrapped fs.ErrNotExist if no spec directories are defined#309
elezar wants to merge 1 commit intocncf-tags:mainfrom
elezar:return-fs-err-no-exits

Conversation

@elezar
Copy link
Contributor

@elezar elezar commented Feb 19, 2026

See the discussion here: #308 (comment)

Here we return a wrapped fs.ErrNotExist error if there are no spec directories defined instead of a raw error that cannot be queried easily by the caller.

@elezar
Copy link
Contributor Author

elezar commented Feb 20, 2026

Thanks @klihub. While working on this, I was wondering whether we want to more strictly define (i.e. return an error from Configure) when no spec directories are defined? With that said, maybe this is a way for a user to instantiate an in-memory cache, but I would rather make that explicit rather than implicit.

@klihub
Copy link
Contributor

klihub commented Feb 20, 2026

Thanks @klihub. While working on this, I was wondering whether we want to more strictly define (i.e. return an error from Configure) when no spec directories are defined?

Yeah, at least my gut feeling is that it sounds like a reasonable idea.

Another option would be to update and document the cdi.WithSpecDirs option to ignore an empty director list and instead run with the defaults... since IFAICT using an explicit cdi.WithSpecDirs() is the only way how you can end up in this situation.

@elezar
Copy link
Contributor Author

elezar commented Feb 20, 2026

Another option would be to update and document the cdi.WithSpecDirs option to ignore an empty director list and instead run with the defaults... since IFAICT using an explicit cdi.WithSpecDirs() is the only way how you can end up in this situation.

I think this is a cleaner solution. Created #310 to do this.

@elezar elezar marked this pull request as draft February 20, 2026 13:32
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar force-pushed the return-fs-err-no-exits branch from 2026e9b to bb2fc73 Compare February 20, 2026 13:32
@elezar
Copy link
Contributor Author

elezar commented Feb 20, 2026

rebased.

@elezar elezar marked this pull request as ready for review February 20, 2026 13:33
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.

2 participants

Comments