Add SedTransformerTest

This commit is contained in:
jregan
2019-05-12 11:22:16 -07:00
parent 61d46c26b8
commit 4df576869f
13 changed files with 142 additions and 22 deletions

View File

@@ -50,7 +50,7 @@ func DefaultSrcRoot() (string, error) {
root = filepath.Join(
os.Getenv("GOPATH"), "src",
pgmconfig.DomainName,
pgmconfig.ProgramName, plugin.PluginRoot)
pgmconfig.ProgramName, pgmconfig.PluginRoot)
if FileExists(root) {
return root, nil
}
@@ -59,7 +59,7 @@ func DefaultSrcRoot() (string, error) {
// get the root kustomize source directory when
// GOPATH is not set
_, filename, _, _ := runtime.Caller(1)
root = path.Join(path.Dir(filename), "../..", plugin.PluginRoot)
root = path.Join(path.Dir(filename), "../..", pgmconfig.PluginRoot)
if FileExists(root) {
return root, nil
}
@@ -73,7 +73,7 @@ func DefaultSrcRoot() (string, error) {
root = filepath.Join(
pgmconfig.HomeDir(),
pgmconfig.ProgramName, plugin.PluginRoot)
pgmconfig.ProgramName, pgmconfig.PluginRoot)
if FileExists(root) {
return root, nil
}

View File

@@ -16,4 +16,4 @@ limitations under the License.
package plugins
const pluginSymbol = "KustomizePlugin"
const PluginSymbol = "KustomizePlugin"

View File

@@ -141,11 +141,11 @@ func (l *Loader) loadGoPlugin(id resid.ResId) (c Configurable, err error) {
if err != nil {
return nil, errors.Wrapf(err, "plugin %s fails to load", name)
}
symbol, err := p.Lookup(pluginSymbol)
symbol, err := p.Lookup(PluginSymbol)
if err != nil {
return nil, errors.Wrapf(
err, "plugin %s doesn't have symbol %s",
name, pluginSymbol)
name, PluginSymbol)
}
c, ok = symbol.(Configurable)
if !ok {