DockerCLI/e2e/cli-plugins/plugins
Ian Campbell b8bfba8dc6
cli-plugins: fix when plugin does not use PersistentPreRun* hooks
This regressed in 3af168c7df ("Ensure plugins can use `PersistentPreRunE`
again.") but this wasn't noticed because the helloworld test plugin has it's
own `PersistentPreRunE` which has the effect of deferring the resolution of the
global variable. In the case where the hook isn't used the variable is resolved
during `newPluginCommand` which is before the global variable was set.

Initialize the plugin command with a stub function wrapping the call to the
(global) hook, this defers resolving the variable until after it has been set,
otherwise the initial value (`nil`) is used in the struct.

Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit af200f14ed)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-13 09:06:08 -07:00
..
badmeta Add some simple e2e tests for executing CLI plugins 2019-01-30 13:44:05 +00:00
nopersistentprerun cli-plugins: fix when plugin does not use PersistentPreRun* hooks 2019-05-13 09:06:08 -07:00