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

Add bash completion for `docker plugin upgrade` #30823

Merged
merged 1 commit into from Feb 13, 2017

Conversation

Projects
None yet
5 participants
@albers
Member

albers commented Feb 8, 2017

Ref #29414
As the corresponding feature will be added in 1.13.1, this PR should go there as well.
Ping @sdurrheimer for zsh completion

Notes for reviewers:
The first non-option is completed as <plugin name:tag>. Completions that include : require __ltrim_colon_completions so that they work on the part after the colon.
The following argument is completed to the available plugin names without the tag, but with a colon appended.

@mlaventure

LGTM, but:

This only works on the master.

On the 1.13.1 tag and 1.13.x, bash correctly completes upgrade but afterwards it doesn't complete the available plugins.

@albers if we were to do a 1.13.2 do you know what other commit would need to be cherry-picked into 1.13.x for this to work?

@albers

This comment has been minimized.

Show comment
Hide comment
@albers

albers Feb 13, 2017

Member

@mlaventure For me, the PR works if cherry-picked onto 1.13.x. Maybe you forgot to install a plugin when you checked?

Member

albers commented Feb 13, 2017

@mlaventure For me, the PR works if cherry-picked onto 1.13.x. Maybe you forgot to install a plugin when you checked?

@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Feb 13, 2017

Contributor

hum, I had vieux/sshfs installed. Let me double checked, maybe I had the old binary running.

Contributor

mlaventure commented Feb 13, 2017

hum, I had vieux/sshfs installed. Let me double checked, maybe I had the old binary running.

Add bash completion for `docker plugin upgrade`
Signed-off-by: Harald Albers <github@albersweb.de>
@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Feb 13, 2017

Contributor

@albers I have the issue with all the plugin commands that should complete on the plugin names actually.

I tried on top of e5a90d4

Contributor

mlaventure commented Feb 13, 2017

@albers I have the issue with all the plugin commands that should complete on the plugin names actually.

I tried on top of e5a90d4

@albers

This comment has been minimized.

Show comment
Hide comment
@albers
Member

albers commented Feb 13, 2017

@albers

This comment has been minimized.

Show comment
Hide comment
@albers

albers Feb 13, 2017

Member

@mlaventure That's really strange. Maybe I'm doing sonething wrong. Here's what I did:

$ git branch
* master
$ git fetch origin 1.13.x
From https://github.com/docker/docker
 * branch            1.13.x     -> FETCH_HEAD
$ git checkout 1.13.x
Branch 1.13.x set up to track remote branch 1.13.x from origin.
Switched to a new branch '1.13.x'
$ git fetch albers completion-plugin-upgrade
From https://github.com/albers/docker
 * branch            completion-plugin-upgrade -> FETCH_HEAD
$ git cherry-pick 2c52ec8403d721e567a7c3c129fc38c650b85ba4
[1.13.x 32428de] Add bash completion for `docker plugin upgrade`
 Date: Wed Feb 8 13:40:13 2017 +0100
 1 file changed, 20 insertions(+)
$ git log --oneline -2
32428de Add bash completion for `docker plugin upgrade`
e5a90d4 Merge pull request #30875 from albers/fix-30858
$ make binary shell BIND_DIR=.

In a separate shell

$ docker exec -ti $(docker ps -lq) dockerd

Back in DIND

root@1af0ae499ea0:~# docker plugin install --grant-all-permissions vieux/sshfs
latest: Pulling from vieux/sshfs
86b5589884b3: Download complete
Digest: sha256:e5e584b1a2d0855d0be5817506e07f774c7c248db42015caa1e605a60c256007
Status: Downloaded newer image for vieux/sshfs:latest
Installed plugin vieux/sshfs

root@1af0ae499ea0:~# docker plugin upgrade <tab>  # works!
Member

albers commented Feb 13, 2017

@mlaventure That's really strange. Maybe I'm doing sonething wrong. Here's what I did:

$ git branch
* master
$ git fetch origin 1.13.x
From https://github.com/docker/docker
 * branch            1.13.x     -> FETCH_HEAD
$ git checkout 1.13.x
Branch 1.13.x set up to track remote branch 1.13.x from origin.
Switched to a new branch '1.13.x'
$ git fetch albers completion-plugin-upgrade
From https://github.com/albers/docker
 * branch            completion-plugin-upgrade -> FETCH_HEAD
$ git cherry-pick 2c52ec8403d721e567a7c3c129fc38c650b85ba4
[1.13.x 32428de] Add bash completion for `docker plugin upgrade`
 Date: Wed Feb 8 13:40:13 2017 +0100
 1 file changed, 20 insertions(+)
$ git log --oneline -2
32428de Add bash completion for `docker plugin upgrade`
e5a90d4 Merge pull request #30875 from albers/fix-30858
$ make binary shell BIND_DIR=.

In a separate shell

$ docker exec -ti $(docker ps -lq) dockerd

Back in DIND

root@1af0ae499ea0:~# docker plugin install --grant-all-permissions vieux/sshfs
latest: Pulling from vieux/sshfs
86b5589884b3: Download complete
Digest: sha256:e5e584b1a2d0855d0be5817506e07f774c7c248db42015caa1e605a60c256007
Status: Downloaded newer image for vieux/sshfs:latest
Installed plugin vieux/sshfs

root@1af0ae499ea0:~# docker plugin upgrade <tab>  # works!
@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Feb 13, 2017

Contributor

@albers rebuilt my docker-dev image (I tend to keep them around a while), it seems to work now. Not sure what was wrong.

Let's get this merged :)

Contributor

mlaventure commented Feb 13, 2017

@albers rebuilt my docker-dev image (I tend to keep them around a while), it seems to work now. Not sure what was wrong.

Let's get this merged :)

@mlaventure mlaventure merged commit c9fa3ee into moby:master Feb 13, 2017

1 check passed

dco-signed All commits are signed
@albers

This comment has been minimized.

Show comment
Hide comment
@albers

albers Feb 13, 2017

Member

@mlaventure Thanks! Are you working on Ubuntu?

Member

albers commented Feb 13, 2017

@mlaventure Thanks! Are you working on Ubuntu?

@mlaventure

This comment has been minimized.

Show comment
Hide comment
@mlaventure

mlaventure Feb 13, 2017

Contributor

I am yes, still on 14.04.5 though

Contributor

mlaventure commented Feb 13, 2017

I am yes, still on 14.04.5 though

@GordonTheTurtle GordonTheTurtle added this to the 1.14.0 milestone Feb 13, 2017

@thaJeztah thaJeztah modified the milestones: 1.13.2, 1.14.0 Feb 13, 2017

@albers albers deleted the albers:completion-plugin-upgrade branch Feb 14, 2017

thaJeztah added a commit to thaJeztah/docker that referenced this pull request Feb 18, 2017

Merge pull request moby#30823 from albers/completion-plugin-upgrade
Add bash completion for `docker plugin upgrade`
(cherry picked from commit c9fa3ee)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment