Skip to content

Commit c8daf1d

Browse files
authored
Merge pull request cncf-tags#310 from elezar/ignore-empty-spec-dirs
Revert to default spec dirs if none are specified
2 parents 5528737 + 62456b2 commit c8daf1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/cdi/spec-dirs.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ var (
4343

4444
// WithSpecDirs returns an option to override the CDI Spec directories.
4545
func WithSpecDirs(dirs ...string) Option {
46+
// If no spec dirs are specified use the default spec dirs.
47+
if len(dirs) == 0 {
48+
return WithSpecDirs(DefaultSpecDirs...)
49+
}
4650
return func(c *Cache) {
4751
specDirs := make([]string, len(dirs))
4852
for i, dir := range dirs {

0 commit comments

Comments
 (0)