Add bash completion for topology-aware scheduling

- bash completion for `docker service create --placement-pref`
- bash completion for `docker service update --placement-pref-{add,rm}`

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2017-03-13 17:35:57 +01:00 committed by Tibor Vass
parent 84ccb00486
commit f50f5f8944
1 changed files with 22 additions and 0 deletions

View File

@ -3027,6 +3027,7 @@ _docker_service_update_and_create() {
--host
--mode
--name
--placement-pref
--publish -p
--secret
"
@ -3052,6 +3053,11 @@ _docker_service_update_and_create() {
COMPREPLY=( $( compgen -W "global replicated" -- "$cur" ) )
return
;;
--placement-pref)
COMPREPLY=( $( compgen -W "spread" -S = -- "$cur" ) )
__docker_nospace
return
;;
--secret)
__docker_complete_secrets
return
@ -3076,6 +3082,8 @@ _docker_service_update_and_create() {
--host-add
--host-rm
--image
--placement-pref-add
--placement-pref-rm
--publish-add
--publish-rm
--rollback
@ -3100,6 +3108,11 @@ _docker_service_update_and_create() {
__docker_complete_image_repos_and_tags
return
;;
--placement-pref-add|--placement-pref-rm)
COMPREPLY=( $( compgen -W "spread" -S = -- "$cur" ) )
__docker_nospace
return
;;
--secret-add|--secret-rm)
__docker_complete_secrets
return
@ -3107,6 +3120,15 @@ _docker_service_update_and_create() {
esac
fi
local strategy=$(__docker_map_key_of_current_option '--placement-pref|--placement-pref-add|--placement-pref-rm')
case "$strategy" in
spread)
COMPREPLY=( $( compgen -W "engine.labels node.labels" -S . -- "${cur##*=}" ) )
__docker_nospace
return
;;
esac
case "$prev" in
--endpoint-mode)
COMPREPLY=( $( compgen -W "dnsrr vip" -- "$cur" ) )