// loadPlatformDependentPlugins registers platform dependent plugins func loadPlatformDependentPlugins(context context.T) PluginRegistry { log := context.Log() var workerPlugins = PluginRegistry{} // registering aws:psModule plugin psModulePluginName := psmodule.Name() psModulePlugin, err := psmodule.NewPlugin(pluginutil.DefaultPluginConfig()) if err != nil { log.Errorf("failed to create plugin %s %v", psModulePluginName, err) } else { workerPlugins[psModulePluginName] = psModulePlugin } // registering aws:applications plugin applicationPluginName := application.Name() applicationPlugin, err := application.NewPlugin(pluginutil.DefaultPluginConfig()) if err != nil { log.Errorf("failed to create plugin %s %v", applicationPluginName, err) } else { workerPlugins[applicationPluginName] = applicationPlugin } return workerPlugins }
// loadPlatformIndependentPlugins registers plugins common to all platforms func loadPlatformIndependentPlugins(context context.T) PluginRegistry { log := context.Log() var workerPlugins = PluginRegistry{} // registering aws:runPowerShellScript & aws:runShellScript plugin runcommandPluginName := runcommand.Name() runcommandPlugin, err := runcommand.NewPlugin(pluginutil.DefaultPluginConfig()) if err != nil { log.Errorf("failed to create plugin %s %v", runcommandPluginName, err) } else { workerPlugins[runcommandPluginName] = runcommandPlugin } // registering aws:updateSsmAgent plugin updateAgentPluginName := updatessmagent.Name() updateAgentPlugin, err := updatessmagent.NewPlugin(updatessmagent.GetUpdatePluginConfig(context)) if err != nil { log.Errorf("failed to create plugin %s %v", updateAgentPluginName, err) } else { workerPlugins[updateAgentPluginName] = updateAgentPlugin } return workerPlugins }