mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Improve plugin home defaulting.
This commit is contained in:
@@ -40,8 +40,11 @@ func NewKustTestHarness(t *testing.T, path string) *KustTestHarness {
|
||||
}
|
||||
|
||||
func NewKustTestHarnessAllowPlugins(t *testing.T, path string) *KustTestHarness {
|
||||
return NewKustTestHarnessFull(
|
||||
t, path, fLdr.RestrictionRootOnly, pgmconfig.EnabledPluginConfig())
|
||||
c, err := pgmconfig.EnabledPluginConfig()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return NewKustTestHarnessFull(t, path, fLdr.RestrictionRootOnly, c)
|
||||
}
|
||||
|
||||
func NewKustTestHarnessNoLoadRestrictor(t *testing.T, path string) *KustTestHarness {
|
||||
@@ -100,7 +103,10 @@ func (th *KustTestHarness) FromMap(m map[string]interface{}) *resource.Resource
|
||||
return th.rf.RF().FromMap(m)
|
||||
}
|
||||
|
||||
func (th *KustTestHarness) FromMapAndOption(m map[string]interface{}, args *types.GeneratorArgs, option *types.GeneratorOptions) *resource.Resource {
|
||||
func (th *KustTestHarness) FromMapAndOption(
|
||||
m map[string]interface{},
|
||||
args *types.GeneratorArgs,
|
||||
option *types.GeneratorOptions) *resource.Resource {
|
||||
return th.rf.RF().FromMapAndOption(m, args, option)
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/api/filesys"
|
||||
"sigs.k8s.io/kustomize/api/pgmconfig"
|
||||
"sigs.k8s.io/kustomize/api/plugins/compiler"
|
||||
)
|
||||
@@ -75,7 +76,7 @@ func (x *PluginTestEnv) makeCompiler() *compiler.Compiler {
|
||||
if err != nil {
|
||||
x.t.Error(err)
|
||||
}
|
||||
srcRoot, err := compiler.DefaultSrcRoot()
|
||||
srcRoot, err := compiler.DefaultSrcRoot(filesys.MakeFsOnDisk())
|
||||
if err != nil {
|
||||
x.t.Error(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user