Register builtin plugins against all available components

This commit is contained in:
sophia 2021-04-26 16:40:00 -05:00 committed by Paul Hinze
parent ab59e254ac
commit d004125712
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 13 additions and 1 deletions

View File

@ -35,6 +35,9 @@ type Plugin struct {
Guest bool
Host bool
SyncedFolder bool
Config bool
LogViewer bool
LogPlatform bool
}
// Checksum is the SHA256 checksum to validate this plugin.
@ -138,6 +141,9 @@ func (p *Plugin) pluginMap() map[interface{}]*bool {
component.ProviderType: &p.Type.Provider,
component.ProvisionerType: &p.Type.Provisioner,
component.SyncedFolderType: &p.Type.SyncedFolder,
component.ConfigType: &p.Type.Config,
component.LogPlatformType: &p.Type.LogPlatform,
component.LogViewerType: &p.Type.LogViewer,
ruby_vagrant.Plugin_COMMAND: &p.Type.Command,
ruby_vagrant.Plugin_COMMUNICATOR: &p.Type.Communicator,
ruby_vagrant.Plugin_GUEST: &p.Type.Guest,

View File

@ -31,15 +31,21 @@ func (r *Runner) LoadPlugins(cfg *configpkg.Config) error {
cfg.TrackRubyPlugin(p.Name, []interface{}{p.Type})
}
components := []interface{}{}
for typ, _ := range plugin.BaseFactories {
components = append(components, typ)
}
// Now lets load builtin plugins
for name, options := range plugin.Builtins {
r.logger.Info("loading builtin plugin " + name)
if plugin.IN_PROCESS_PLUGINS {
if err := r.builtinPlugins.Add(name, options...); err != nil {
return err
}
}
cfg.TrackBuiltinPlugin(name, []interface{}{component.CommandType})
cfg.TrackBuiltinPlugin(name, components)
}
return nil