mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
check for walkErr before fileInfo deref
This commit is contained in:
parent
843c40e32e
commit
77ac3290d6
@ -67,7 +67,7 @@ func (l *DirectoryPluginLoader) Load() (Plugins, error) {
|
|||||||
// read the base directory tree searching for plugin descriptors
|
// read the base directory tree searching for plugin descriptors
|
||||||
// fails silently (descriptors unable to be read or unmarshalled are logged but skipped)
|
// fails silently (descriptors unable to be read or unmarshalled are logged but skipped)
|
||||||
err = filepath.Walk(base, func(path string, fileInfo os.FileInfo, walkErr error) error {
|
err = filepath.Walk(base, func(path string, fileInfo os.FileInfo, walkErr error) error {
|
||||||
if fileInfo.IsDir() || fileInfo.Name() != PluginDescriptorFilename || walkErr != nil {
|
if walkErr != nil || fileInfo.IsDir() || fileInfo.Name() != PluginDescriptorFilename {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user