mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
Refactor exec plugin load to error if plugin isn't executable
This commit is contained in:
@@ -5,6 +5,7 @@ package loader
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"plugin"
|
||||
"reflect"
|
||||
@@ -145,10 +146,13 @@ func (l *Loader) makeBuiltinPlugin(r resid.Gvk) (resmap.Configurable, error) {
|
||||
}
|
||||
|
||||
func (l *Loader) loadPlugin(resId resid.ResId) (resmap.Configurable, error) {
|
||||
p := execplugin.NewExecPlugin(l.absolutePluginPath(resId))
|
||||
if p.IsAvailable() {
|
||||
p, err := execplugin.NewExecPlugin(l.absolutePluginPath(resId))
|
||||
if err == nil {
|
||||
return p, nil
|
||||
}
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
c, err := l.loadGoPlugin(resId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user