Skip to content

Commit

Permalink
Pass plugin-params also for modules (#1640)
Browse files Browse the repository at this point in the history
In #1624 we've ensured that plugins that have turned into modules are
now skipped from the mandatory plugin check. However, we've also not
passed any plugin parameters to the provisioner and this made post
installation hooks fail, if they expected parameters to be passed on the
command line via `--plugin-params` (e.g. `repository-gcs`). With this
commit we make sure that `--plugin-params` is still honored even in
these cases.

Relates #1624
  • Loading branch information
danielmitterdorfer authored Dec 21, 2022
1 parent 27b3ba5 commit 4c7141a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions esrally/mechanic/provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,14 @@ def _provisioner_variables(self):
plugin_variables = {}
mandatory_plugins = []
for installer in self.plugin_installers:
plugin_variables.update(installer.variables)
if installer.plugin.moved_to_module:
self.logger.info(
"Skipping adding plugin [%s] to cluster setting 'plugin.mandatory' as it has been moved to a module",
installer.plugin_name,
)
continue

mandatory_plugins.append(installer.plugin_name)
plugin_variables.update(installer.variables)
else:
mandatory_plugins.append(installer.plugin_name)

cluster_settings = {}
if mandatory_plugins:
Expand Down
3 changes: 2 additions & 1 deletion tests/mechanic/provisioner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def null_apply_config(source_root_path, target_root_path, config_vars):
for p in plugins_moved_to_modules:
plugin_installers.append(
provisioner.PluginInstaller(
team.PluginDescriptor(p, core_plugin=False),
team.PluginDescriptor(p, core_plugin=False, variables={"plugin-turned-to-module": "some value"}),
java_home="/usr/local/javas/java8",
hook_handler_class=self.NoopHookHandler,
)
Expand All @@ -274,6 +274,7 @@ def null_apply_config(source_root_path, target_root_path, config_vars):
_, _, config_vars = apply_config_calls[0]

assert not config_vars["cluster_settings"].get("plugin.mandatory")
assert "plugin-turned-to-module" in p._provisioner_variables()


class NoopHookHandler:
Expand Down

0 comments on commit 4c7141a

Please sign in to comment.