From 292fc5c58019887609a7061c35a937dde69bc131 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 25 Apr 2019 22:55:21 +0200 Subject: [PATCH 1/5] Remove deprecated storage drivers from bash completion Signed-off-by: Harald Albers (cherry picked from commit bfa43d2989903a6b6d02940351be3cafef4cecfb) Signed-off-by: Sebastiaan van Stijn --- contrib/completion/bash/docker | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index c41f00a573..e5904531fe 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2617,36 +2617,15 @@ _docker_daemon() { return ;; --storage-driver|-s) - COMPREPLY=( $( compgen -W "aufs btrfs devicemapper overlay overlay2 vfs zfs" -- "$(echo "$cur" | tr '[:upper:]' '[:lower:]')" ) ) + COMPREPLY=( $( compgen -W "aufs btrfs overlay2 vfs zfs" -- "$(echo "$cur" | tr '[:upper:]' '[:lower:]')" ) ) return ;; --storage-opt) local btrfs_options="btrfs.min_space" - local devicemapper_options=" - dm.basesize - dm.blkdiscard - dm.blocksize - dm.directlvm_device - dm.fs - dm.libdm_log_level - dm.loopdatasize - dm.loopmetadatasize - dm.min_free_space - dm.mkfsarg - dm.mountopt - dm.override_udev_sync_check - dm.thinpooldev - dm.thinp_autoextend_percent - dm.thinp_autoextend_threshold - dm.thinp_metapercent - dm.thinp_percent - dm.use_deferred_deletion - dm.use_deferred_removal - " local overlay2_options="overlay2.size" local zfs_options="zfs.fsname" - local all_options="$btrfs_options $devicemapper_options $overlay2_options $zfs_options" + local all_options="$btrfs_options $overlay2_options $zfs_options" case $(__docker_value_of_option '--storage-driver|-s') in '') @@ -2655,9 +2634,6 @@ _docker_daemon() { btrfs) COMPREPLY=( $( compgen -W "$btrfs_options" -S = -- "$cur" ) ) ;; - devicemapper) - COMPREPLY=( $( compgen -W "$devicemapper_options" -S = -- "$cur" ) ) - ;; overlay2) COMPREPLY=( $( compgen -W "$overlay2_options" -S = -- "$cur" ) ) ;; From af9b8c1be3705b4301cbf5aee1f10117a701301c Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 25 Apr 2019 23:49:30 +0200 Subject: [PATCH 2/5] Add bash completion for `--security-opt systempaths=unconfined` Signed-off-by: Harald Albers (cherry picked from commit 1648d6c4a4fd35b6b349680654380ccf1184dcf4) Signed-off-by: Sebastiaan van Stijn --- contrib/completion/bash/docker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index e5904531fe..255587120e 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2112,8 +2112,8 @@ _docker_container_run_and_create() { return ;; --security-opt) - COMPREPLY=( $( compgen -W "apparmor= label= no-new-privileges seccomp=" -- "$cur") ) - if [ "${COMPREPLY[*]}" != "no-new-privileges" ] ; then + COMPREPLY=( $( compgen -W "apparmor= label= no-new-privileges seccomp= systempaths=unconfined" -- "$cur") ) + if [[ ${COMPREPLY[*]} = *= ]] ; then __docker_nospace fi return From c1754d9e5db323f0b50bfad7515f8998f845d7a1 Mon Sep 17 00:00:00 2001 From: Trapier Marshall Date: Tue, 7 May 2019 14:26:20 -0400 Subject: [PATCH 3/5] bash completion: add node type filter Signed-off-by: Trapier Marshall (cherry picked from commit 50a45babacbc0d2a7c983b2a983061ec0470df1e) Signed-off-by: Sebastiaan van Stijn --- contrib/completion/bash/docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 255587120e..52577ece5e 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -5159,7 +5159,7 @@ _docker_system_events() { return ;; type) - COMPREPLY=( $( compgen -W "config container daemon image network plugin secret service volume" -- "${cur##*=}" ) ) + COMPREPLY=( $( compgen -W "config container daemon image network node plugin secret service volume" -- "${cur##*=}" ) ) return ;; volume) From 68d67f2cbfb4d1a5ca7bed716f1af41327d5e9e8 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Fri, 10 May 2019 21:48:27 +0200 Subject: [PATCH 4/5] Add bash completion for `context create --from` Signed-off-by: Harald Albers (cherry picked from commit b55992afc6a063fbb45c6eb6b1d930df03f6430d) Signed-off-by: Sebastiaan van Stijn --- contrib/completion/bash/docker | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 52577ece5e..ad0fc1238d 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2342,11 +2342,15 @@ _docker_context_create() { --description|--docker|--kubernetes) return ;; + --from) + __docker_complete_contexts + return + ;; esac case "$cur" in -*) - COMPREPLY=( $( compgen -W "--default-stack-orchestrator --description --docker --help --kubernetes" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--default-stack-orchestrator --description --docker --from --help --kubernetes" -- "$cur" ) ) ;; esac } From 8cf8fc27fa01abccd4ea8e1ba9a3034c853cf46b Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Fri, 10 May 2019 22:14:39 +0200 Subject: [PATCH 5/5] Add bash completion for `events --filter node` Signed-off-by: Harald Albers (cherry picked from commit c1639e1e42903e008d75ac1454f13d9c1d3b0e3e) Signed-off-by: Sebastiaan van Stijn --- contrib/completion/bash/docker | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index ad0fc1238d..0c0fa986af 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -5158,6 +5158,10 @@ _docker_system_events() { __docker_complete_networks --cur "${cur##*=}" return ;; + node) + __docker_complete_nodes --cur "${cur##*=}" + return + ;; scope) COMPREPLY=( $( compgen -W "local swarm" -- "${cur##*=}" ) ) return @@ -5174,7 +5178,7 @@ _docker_system_events() { case "$prev" in --filter|-f) - COMPREPLY=( $( compgen -S = -W "container daemon event image label network scope type volume" -- "$cur" ) ) + COMPREPLY=( $( compgen -S = -W "container daemon event image label network node scope type volume" -- "$cur" ) ) __docker_nospace return ;;