diff --git a/cmd/root.go b/cmd/root.go index d149d1a046c32e9c9f8fde138f9d2d5c15937d39..9991badce669cfdd2abd2c2a58b19ec4188f59cc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( goflag "flag" "fmt" + "os" "path/filepath" "github.com/golang/glog" @@ -38,6 +39,12 @@ func JsonnetVM(cmd *cobra.Command) (*jsonnet.VM, error) { vm := jsonnet.Make() flags := cmd.Flags() + jpath := os.Getenv("KUBECFG_JPATH") + for _, p := range filepath.SplitList(jpath) { + glog.V(2).Infoln("Adding jsonnet search path", p) + vm.JpathAdd(p) + } + jpath, err := flags.GetString("jpath") if err != nil { return nil, err