Append mappers to a plugin component
This commit is contained in:
parent
7595f1533f
commit
63c71b0a20
@ -552,6 +552,10 @@ type HasParents interface {
|
||||
Parent() (string, error)
|
||||
}
|
||||
|
||||
type HasMappers interface {
|
||||
AppendMappers(...*argmapper.Func)
|
||||
}
|
||||
|
||||
func (b *Basis) loadParentPlugin(p *plugin.Plugin, typ component.Type) (err error) {
|
||||
plg, err := p.InstanceOf(typ)
|
||||
if err != nil {
|
||||
@ -626,7 +630,11 @@ func (b *Basis) component(
|
||||
|
||||
// TODO(spox): we need to add hooks
|
||||
|
||||
if cm, ok := c.Component.(HasMappers); ok {
|
||||
cm.AppendMappers(c.Mappers...)
|
||||
}
|
||||
hooks := map[string][]*config.Hook{}
|
||||
allMappers := append(b.mappers, p.Mappers...)
|
||||
return &Component{
|
||||
Value: c.Component,
|
||||
Info: &vagrant_server.Component{
|
||||
@ -635,7 +643,7 @@ func (b *Basis) component(
|
||||
ServerAddr: b.Client().ServerTarget(),
|
||||
},
|
||||
hooks: hooks,
|
||||
mappers: append(b.mappers, p.Mappers...),
|
||||
mappers: allMappers,
|
||||
plugin: c,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user