Skip to content

Commit e283ced

Browse files
committed
Allow odc.GenerateEPNTopologyFullname in the root role
1 parent 2107a76 commit e283ced

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

core/integration/plugin.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import (
3636
var log = logger.New(logrus.StandardLogger(), "integration")
3737

3838
var (
39-
once sync.Once
40-
instance Plugins
39+
once sync.Once
40+
instance Plugins
4141

4242
loaderOnce sync.Once
4343
pluginLoaders map[string]func() Plugin
@@ -53,14 +53,14 @@ type Plugin interface {
5353
GetData(environmentIds []uid.ID) string
5454

5555
Init(instanceId string) error
56-
CallStack(data interface{}) map[string]interface{} // used in hook call context
56+
CallStack(data interface{}) map[string]interface{} // used in hook call context
5757
ObjectStack(varStack map[string]string) map[string]interface{} // all other ProcessTemplates contexts
5858
Destroy() error
5959
}
6060

6161
type NewFunc func(endpoint string) Plugin
6262

63-
func RegisteredPlugins() map[string] func() Plugin {
63+
func RegisteredPlugins() map[string]func() Plugin {
6464
return pluginLoaders
6565
}
6666

@@ -116,6 +116,14 @@ func (p Plugins) CallStack(data interface{}) (stack map[string]interface{}) {
116116

117117
func (p Plugins) ObjectStack(varStack map[string]string) (stack map[string]interface{}) {
118118
stack = make(map[string]interface{})
119+
120+
//HACK: this is a dummy object+function to allow odc.GenerateEPNTopologyFullname in the root role
121+
stack["odc"] = map[string]interface{}{
122+
"GenerateEPNTopologyFullname": func() string {
123+
return ""
124+
},
125+
}
126+
119127
for _, plugin := range p {
120128
s := plugin.ObjectStack(varStack)
121129
stack[plugin.GetName()] = s

0 commit comments

Comments
 (0)