Skip to content

Commit

Permalink
pkg/cdi: drop unused return value from Configure methods
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Lehtonen <[email protected]>
  • Loading branch information
marquiz committed Jan 18, 2024
1 parent 6e50a6b commit f69e67c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 6 additions & 10 deletions pkg/cdi/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,13 @@ func NewCache(options ...Option) *Cache {

// Configure applies options to the Cache. Updates and refreshes the
// Cache if options have changed.
func (c *Cache) Configure(options ...Option) error {
if len(options) == 0 {
return nil
}

c.Lock()
defer c.Unlock()

c.configure(options...)
func (c *Cache) Configure(options ...Option) {
if len(options) != 0 {
c.Lock()
defer c.Unlock()

return nil
c.configure(options...)
}
}

// Configure the Cache. Start/stop CDI Spec directory watch, refresh
Expand Down
4 changes: 2 additions & 2 deletions pkg/cdi/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Registry interface {
// GetSpecDirErrors returns any errors related to the configured
// Spec directories.
type RegistryRefresher interface {
Configure(...Option) error
Configure(...Option)
Refresh() error
GetErrors() map[string][]error
GetSpecDirectories() []string
Expand Down Expand Up @@ -129,7 +129,7 @@ func GetRegistry(options ...Option) Registry {
})
if !new && len(options) > 0 {
// We don't care about errors here
_ = reg.Configure(options...)
reg.Configure(options...)
_ = reg.Refresh()
}
return reg
Expand Down

0 comments on commit f69e67c

Please sign in to comment.