diff --git a/pkg/kubectl/plugins/loader.go b/pkg/kubectl/plugins/loader.go index 6a34a150d7c..1301dbbb3c3 100644 --- a/pkg/kubectl/plugins/loader.go +++ b/pkg/kubectl/plugins/loader.go @@ -67,7 +67,7 @@ func (l *DirectoryPluginLoader) Load() (Plugins, error) { // read the base directory tree searching for plugin descriptors // 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 { - if fileInfo.IsDir() || fileInfo.Name() != PluginDescriptorFilename || walkErr != nil { + if walkErr != nil || fileInfo.IsDir() || fileInfo.Name() != PluginDescriptorFilename { return nil }