-
Notifications
You must be signed in to change notification settings - Fork 2k
Docker cli slows bash init #4505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think the CLI could still improve here because it looks like it is making an API call to the _ping
endpoint, but lazily evaluating the plugin path looks like the right thing to do here.
This needs a DCO sign-off.
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4505 +/- ##
=======================================
Coverage 59.38% 59.38%
=======================================
Files 288 288
Lines 24783 24783
=======================================
Hits 14717 14717
Misses 9179 9179
Partials 887 887 |
One complain from the shellcheck:
|
|
I understand the general sentiment, but it is not correct generally and specifically in this case it is wrong:
I can change it to have the double quotes just to silence shellcheck, but that is just pasting over the real problem, which is shellcheck being over enthusiastic about recommendations that are not universally correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much for the contribution.
Functionally LGTM, but I'd like a naming change, see comment.
For the linting error (assuming the current code is technically correct (I'm always confused by quotes in bash)); I think it'd be ok to add a (unless there's another option that's both "good' and keeps the linter at bay of course) |
I don't think shellcheck is being completely incorrect here - the This won't affect the word-split that we want to happen in the for plugin_path in $(__docker_plugins_path); do |
OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could you also squash your commits into one please?
Fixes issue #3889 by only loading docker plugins path when needed: if it is fast enough than it shouldn't be a problem to do this on demand; OTOH if it is slow then we shouldn't do this during *every* bash session initialization, regardless if docker completion will be needed or not. Signed-off-by: Oded Arbel <oded@geek.co.il>
Can do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
I'm looking forward to this change becoming GA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
- What I did
Instead of caching the docker plugins paths during bash init, put it in a function to be called as needed.
- How I did it
This is a very simply patch that should be self evident.
- How to verify it
Check that it doesn't affect completion results with plugins installed
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)