diff --git a/internal/core/basis.go b/internal/core/basis.go index bf3b44f3e..a1a5504a6 100644 --- a/internal/core/basis.go +++ b/internal/core/basis.go @@ -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 }