Uh oh!
There was an error while loading. Please reload this page.
Docker cli slows bash init - #4505
Conversation
cpuguy83
left a comment
There was a problem hiding this comment.
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.
cpuguy83
commented
Aug 21, 2023
This needs a DCO sign-off.
|
codecov-commenter
commented
Aug 22, 2023
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 |
thaJeztah
commented
Aug 22, 2023
vvoland
commented
Aug 22, 2023
One complain from the shellcheck: |
thaJeztah
commented
Aug 22, 2023
|
guss77
commented
Aug 22, 2023
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. |
albers
left a comment
There was a problem hiding this comment.
Thanks very much for the contribution.
Functionally LGTM, but I'd like a naming change, see comment.
Uh oh!
There was an error while loading. Please reload this page.
thaJeztah
commented
Aug 22, 2023
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) |
vvoland
commented
Aug 23, 2023
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 forplugin_pathin$(__docker_plugins_path);do |
guss77
commented
Aug 23, 2023
OK |
vvoland
left a comment
There was a problem hiding this comment.
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>
guss77
commented
Aug 23, 2023
Can do. |
albers
left a comment
There was a problem hiding this comment.
LGTM, thanks.
I'm looking forward to this change becoming GA.
- 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)