Loader FS and empty env fix

This commit is contained in:
Katrina Verey
2021-03-24 17:40:59 -07:00
parent e77c284924
commit 3255c73c71
12 changed files with 100 additions and 44 deletions

View File

@@ -76,7 +76,7 @@ func (th Harness) MakeOptionsPluginsDisabled() krusty.Options {
// Enables use of non-builtin plugins.
func (th Harness) MakeOptionsPluginsEnabled() krusty.Options {
pc := konfig.EnabledPluginConfig(types.BploLoadFromFileSys)
pc := types.EnabledPluginConfig(types.BploLoadFromFileSys)
o := *krusty.MakeDefaultOptions()
o.PluginConfig = pc
return o

View File

@@ -40,7 +40,7 @@ type HarnessEnhanced struct {
func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced {
pte := newPluginTestEnv(t).set()
pc := konfig.EnabledPluginConfig(types.BploLoadFromFileSys)
pc := types.EnabledPluginConfig(types.BploLoadFromFileSys)
pc.FnpLoadingOptions.EnableStar = true
p := provider.NewDefaultDepProvider()
resourceFactory := p.GetResourceFactory()
@@ -50,7 +50,8 @@ func MakeEnhancedHarness(t *testing.T) *HarnessEnhanced {
Harness: MakeHarness(t),
pte: pte,
rf: resmapFactory,
pl: pLdr.NewLoader(pc, resmapFactory)}
// The plugin configs are always located on disk, regardless of the test harness's FS
pl: pLdr.NewLoader(pc, resmapFactory, filesys.MakeFsOnDisk())}
// Point the file loader to the root ('/') of the in-memory file system.
result.ResetLoaderRoot(filesys.Separator)