mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 09:24:23 +00:00
Simplify plugin loader code.
* use one place to build plugin file names, * use one loader instance, * test for plugin enabled flag in just one place to avoid errors and reduce if statements, * don't return private objects, * factor goplugin loading to a method, * fix a related test that was commented out.
This commit is contained in:
@@ -23,7 +23,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/k8sdeps/kv/plugin"
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
"sigs.k8s.io/kustomize/pkg/ifc"
|
||||
"sigs.k8s.io/kustomize/pkg/internal/loadertest"
|
||||
@@ -206,8 +205,7 @@ func TestResources(t *testing.T) {
|
||||
|
||||
func TestKustomizationNotFound(t *testing.T) {
|
||||
_, err := NewKustTarget(
|
||||
loadertest.NewFakeLoader("/foo"),
|
||||
nil, nil, plugin.DefaultPluginConfig())
|
||||
loadertest.NewFakeLoader("/foo"), nil, nil, nil)
|
||||
if err == nil {
|
||||
t.Fatalf("expected an error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user