Merge pull request #3744 from KnVerey/plugin-dir-error

Do no require exec/go plugin home to use fn plugins
This commit is contained in:
Jeff Regan
2021-03-26 11:26:48 -07:00
committed by GitHub
15 changed files with 169 additions and 116 deletions

View File

@@ -8,8 +8,8 @@ import (
)
func TestFnExecGenerator(t *testing.T) {
th := kusttest_test.MakeEnhancedHarness(t)
defer th.Reset()
// Function plugins should not need the env setup done by MakeEnhancedHarness
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
resources:
@@ -92,8 +92,8 @@ func skipIfNoDocker(t *testing.T) {
func TestFnContainerGenerator(t *testing.T) {
skipIfNoDocker(t)
th := kusttest_test.MakeEnhancedHarness(t)
defer th.Reset()
// Function plugins should not need the env setup done by MakeEnhancedHarness
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
resources:
@@ -308,8 +308,8 @@ spec:
func TestFnContainerTransformer(t *testing.T) {
skipIfNoDocker(t)
th := kusttest_test.MakeEnhancedHarness(t)
defer th.Reset()
// Function plugins should not need the env setup done by MakeEnhancedHarness
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
resources:
@@ -408,8 +408,8 @@ spec:
func TestFnContainerTransformerWithConfig(t *testing.T) {
skipIfNoDocker(t)
th := kusttest_test.MakeEnhancedHarness(t)
defer th.Reset()
// Function plugins should not need the env setup done by MakeEnhancedHarness
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
resources:
@@ -468,8 +468,8 @@ metadata:
func TestFnContainerEnvVars(t *testing.T) {
skipIfNoDocker(t)
th := kusttest_test.MakeEnhancedHarness(t)
defer th.Reset()
// Function plugins should not need the env setup done by MakeEnhancedHarness
th := kusttest_test.MakeHarness(t)
th.WriteK(".", `
generators:

View File

@@ -66,7 +66,8 @@ func (b *Kustomizer) Run(
ldr,
b.depProvider.GetFieldValidator(),
resmapFactory,
pLdr.NewLoader(b.options.PluginConfig, resmapFactory),
// The plugin configs are always located on disk, regardless of the fSys passed in
pLdr.NewLoader(b.options.PluginConfig, resmapFactory, filesys.MakeFsOnDisk()),
)
err = kt.Load()
if err != nil {

View File

@@ -5,7 +5,6 @@ package krusty
import (
"sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers"
"sigs.k8s.io/kustomize/api/konfig"
"sigs.k8s.io/kustomize/api/types"
)
@@ -42,7 +41,7 @@ func MakeDefaultOptions() *Options {
AddManagedbyLabel: false,
LoadRestrictions: types.LoadRestrictionsRootOnly,
DoPrune: false,
PluginConfig: konfig.DisabledPluginConfig(),
PluginConfig: types.DisabledPluginConfig(),
}
}