Skip to content

[19.03 backport] plugin fixes - #1878

Merged
tiborvass merged 5 commits into
docker:19.03from
thaJeztah:19.03_plugin_fixes
May 13, 2019
Merged

[19.03 backport] plugin fixes#1878
tiborvass merged 5 commits into
docker:19.03from
thaJeztah:19.03_plugin_fixes

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

backports for 19.03 of:

Ian Campbell added 5 commits May 13, 2019 09:05
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit d57175a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Previously `docker --badopt` would always include experimental commands even if
experimental was not enabled.
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 79a75da)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Previously `docker --badopt` output would not include CLI plugins.
Fixesdocker#1813
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 40a6cf7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The linter is complaining:
cmd/docker/docker.go:72:23:warning: dockerCli can be github.com/docker/cli/cli/command.Cli (interfacer)
Unclear precisely which change in the preceeding commits caused it to notice
this possibility.
Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 7d0645c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This regressed in 3af168c ("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 af200f1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
MemberAuthor

@thaJeztah
thaJeztah changed the base branch from master to 19.03May 13, 2019 16:10
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1878 into 19.03 will decrease coverage by 0.01%.
The diff coverage is 20%.

@@ Coverage Diff @@## 19.03 #1878 +/- ##
==========================================
- Coverage 56.75% 56.74% -0.02% 
==========================================
Files 309 309 Lines 21658 21662 +4 ==========================================
Hits 12292 12292 - Misses 8469 8473 +4 
Partials 897 897

@silvin-lubeckisilvin-lubecki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tiborvass
tiborvass merged commit 394c393 into docker:19.03May 13, 2019
@thaJeztah
thaJeztah deleted the 19.03_plugin_fixes branch May 13, 2019 22:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@thaJeztah@codecov-io@tiborvass@silvin-lubecki@GordonTheTurtle