add support for exec plugins

This commit is contained in:
Jingfang Liu
2019-04-12 15:41:41 -07:00
parent 28cb6daec7
commit f6e01cfda7
11 changed files with 263 additions and 108 deletions

View File

@@ -17,7 +17,9 @@ import (
"fmt"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"time"
"sigs.k8s.io/kustomize/k8sdeps/kv/plugin"
@@ -51,6 +53,15 @@ func DefaultSrcRoot() (string, error) {
}
nope = append(nope, root)
// get the root kustomize source directory when
// GOPATH is not set
_, filename, _, _ := runtime.Caller(1)
root = path.Join(path.Dir(filename), "../..", plugin.PluginRoot)
if FileExists(root) {
return root, nil
}
nope = append(nope, root)
root = filepath.Join(
pgmconfig.ConfigRoot(), plugin.PluginRoot)
if FileExists(root) {