fix comment and add some logging in discovery
This commit is contained in:
parent
ea3d9c86ba
commit
283ae0c7c4
|
@ -2,6 +2,7 @@ package discovery
|
|||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
@ -55,6 +56,8 @@ func findPluginPaths(kind string, machineName string, dirs []string) []string {
|
|||
continue
|
||||
}
|
||||
|
||||
log.Printf("[DEBUG] checking for plugins in %q", baseDir)
|
||||
|
||||
for _, item := range baseItems {
|
||||
fullName := item.Name()
|
||||
|
||||
|
@ -66,6 +69,8 @@ func findPluginPaths(kind string, machineName string, dirs []string) []string {
|
|||
continue
|
||||
}
|
||||
|
||||
log.Printf("[DEBUG] checking for plugins in %q", machineDir)
|
||||
|
||||
for _, item := range machineItems {
|
||||
fullName := item.Name()
|
||||
|
||||
|
@ -83,6 +88,8 @@ func findPluginPaths(kind string, machineName string, dirs []string) []string {
|
|||
continue
|
||||
}
|
||||
|
||||
log.Printf("[DEBUG] found plugin %q", fullName)
|
||||
|
||||
ret = append(ret, filepath.Clean(absPath))
|
||||
}
|
||||
|
||||
|
@ -96,6 +103,8 @@ func findPluginPaths(kind string, machineName string, dirs []string) []string {
|
|||
continue
|
||||
}
|
||||
|
||||
log.Printf("[DEBUG] found legacy plugin %q", fullName)
|
||||
|
||||
ret = append(ret, filepath.Clean(absPath))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ func (s PluginMetaSet) Newest() PluginMeta {
|
|||
// name and an appropriate version.
|
||||
//
|
||||
// If any of the given requirements match *no* plugins then its PluginMetaSet
|
||||
// in the returned map will be nil.
|
||||
// in the returned map will be empty.
|
||||
//
|
||||
// All viable metas are returned, so the caller can apply any desired filtering
|
||||
// to reduce down to a single option. For example, calling Newest() to obtain
|
||||
|
|
Loading…
Reference in New Issue