Skip to content

Commit

Permalink
fix logic issue
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Zappa <[email protected]>
  • Loading branch information
MikeZappa87 committed Apr 7, 2024
1 parent ec41865 commit 49e9d56
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,21 @@ func loadFromConfDir(c *libcni, max int) error {
}

func checkPluginExists(c *libcni, confList *cnilibrary.NetworkConfigList) error {
var err error
for _, plug := range confList.Plugins {
plugin := plug.Network.Type
for _, dir := range c.pluginDirs {
if !fileExistsInDir(dir, plugin) {
return fmt.Errorf("plugin %s not found in: %s %v", plugin, strings.Join(c.pluginDirs, ","), ErrCNIPluginNotFound)
err = fmt.Errorf("plugin '%s' not found in: %s %v", plugin, strings.Join(c.pluginDirs, ","), ErrCNIPluginNotFound)
} else {
err = nil
continue
}
}

if err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit 49e9d56

Please sign in to comment.