mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-21 14:32:03 +00:00
Make plugin dir match Go conventions.
This commit is contained in:
@@ -36,6 +36,7 @@ func TestCompiler(t *testing.T) {
|
||||
if configRoot != c.ObjRoot() {
|
||||
t.Errorf("unexpected objRoot %s", c.ObjRoot())
|
||||
}
|
||||
|
||||
expectObj := filepath.Join(
|
||||
c.ObjRoot(),
|
||||
"someteam.example.com", "v1", "DatePrefixer.so")
|
||||
@@ -49,6 +50,21 @@ func TestCompiler(t *testing.T) {
|
||||
if !RecentFileExists(expectObj) {
|
||||
t.Errorf("didn't find expected obj file %s", expectObj)
|
||||
}
|
||||
|
||||
expectObj = filepath.Join(
|
||||
c.ObjRoot(),
|
||||
"builtin", "", "SecretGenerator.so")
|
||||
if FileExists(expectObj) {
|
||||
t.Errorf("obj file should not exist yet: %s", expectObj)
|
||||
}
|
||||
err = c.Compile("builtin", "", "SecretGenerator")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if !RecentFileExists(expectObj) {
|
||||
t.Errorf("didn't find expected obj file %s", expectObj)
|
||||
}
|
||||
|
||||
err = os.RemoveAll(c.ObjRoot())
|
||||
if err != nil {
|
||||
t.Errorf(
|
||||
|
||||
@@ -53,7 +53,7 @@ s/$BAR/bar/g
|
||||
|
||||
p.Config(ldr, rf, pluginConfig)
|
||||
|
||||
expected := "/kustomize/plugins/someteam.example.com/v1/SedTransformer"
|
||||
expected := "/kustomize/plugin/someteam.example.com/v1/SedTransformer"
|
||||
if !strings.HasSuffix(p.name, expected) {
|
||||
t.Fatalf("expected suffix '%s', got '%s'", expected, p.name)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
secretGenerator = `apiVersion: kustomize.config.k8s.io/v1
|
||||
secretGenerator = `
|
||||
apiVersion: builtin
|
||||
kind: SecretGenerator
|
||||
metadata:
|
||||
name: secretGenerator
|
||||
@@ -59,7 +60,7 @@ func TestLoader(t *testing.T) {
|
||||
defer tc.Reset()
|
||||
|
||||
tc.BuildGoPlugin(
|
||||
"kustomize.config.k8s.io", "v1", "SecretGenerator")
|
||||
"builtin", "", "SecretGenerator")
|
||||
tc.BuildGoPlugin(
|
||||
"someteam.example.com", "v1", "ServiceGenerator")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user