DockerCLI/e2e/cli-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
..
plugins cli-plugins: fix when plugin does not use PersistentPreRun* hooks 2019-05-13 09:06:08 -07:00
testdata e2e/cli-plugins: explicitly check that PersistentPreRunE works 2019-03-14 14:20:19 +00:00
config_test.go Simplify cli plugin config file entry 2019-02-25 10:38:48 +00:00
dial_test.go Merge pull request #1745 from ijc/disable-dial-stdio-for-plugins 2019-03-18 12:29:41 +01:00
flags_test.go e2e: Add tests for #1801 (global args parsed multiple times) 2019-04-03 15:07:38 +01:00
help_test.go Include CLI plugins in help output on unknown flag. 2019-05-13 09:05:45 -07:00
main_test.go e2e: Add a TestMain for cli plugins tests 2019-04-03 15:06:34 +01:00
run_test.go cli-plugins: fix when plugin does not use PersistentPreRun* hooks 2019-05-13 09:06:08 -07:00
util_test.go Simplify cli plugin config file entry 2019-02-25 10:38:48 +00:00