diff --git a/internal/plugin/plugin.go b/internal/plugin/plugin.go index 721d72600..e864f4bc0 100644 --- a/internal/plugin/plugin.go +++ b/internal/plugin/plugin.go @@ -11,6 +11,7 @@ import ( sdk "github.com/hashicorp/vagrant-plugin-sdk" "github.com/hashicorp/vagrant-plugin-sdk/component" + "github.com/hashicorp/vagrant-plugin-sdk/core" "github.com/hashicorp/vagrant-plugin-sdk/internal-shared/cacher" "github.com/hashicorp/vagrant/builtin/myplugin" "github.com/hashicorp/vagrant/builtin/otherplugin" @@ -190,6 +191,18 @@ func (p *Plugin) InstanceOf( return } +func (p *Plugin) SeedPlugin(typ component.Type, args ...interface{}) error { + seedTarget := p.components[typ].Component + if s, ok := seedTarget.(core.Seeder); ok { + if err := s.Seed(args...); err != nil { + return err + } + } else { + return fmt.Errorf("host plugin does not support seeder interface") + } + return nil +} + // Helper that returns supported types as strings func (p *Plugin) types() []string { result := []string{}