Merge pull request #957 from monopole/justTheFactsMaam

Define a plugin compiler.
This commit is contained in:
Kubernetes Prow Robot
2019-04-08 18:33:04 -07:00
committed by GitHub
9 changed files with 259 additions and 107 deletions

View File

@@ -82,12 +82,13 @@ func loadAndConfigurePlugin(
rf *resmap.Factory, res *resource.Resource) (Configurable, error) {
goPlugin, err := plugin.Open(fileName)
if err != nil {
return nil, fmt.Errorf("plugin %s file not opened", fileName)
return nil, errors.Wrapf(err, "plugin %s fails to load", fileName)
}
symbol, err := goPlugin.Lookup(kplugin.PluginSymbol)
if err != nil {
return nil, fmt.Errorf(
"plugin %s doesn't have symbol %s", fileName, kplugin.PluginSymbol)
return nil, errors.Wrapf(
err, "plugin %s doesn't have symbol %s",
fileName, kplugin.PluginSymbol)
}
c, ok := symbol.(Configurable)
if !ok {