소스 검색

remove "secrets" from completion scripts

Swarm join has been changed in f5e1f6f6880391a5a3399023cf93a3c48502e57d,
removing various options and the "node accept" command.

This removes the removed options from the completion
scripts.

NOTE: a new command ("docker swarm join-token") was
also added, but is not part of this commit.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 9 년 전
부모
커밋
c4ab20c5f8
2개의 변경된 파일11개의 추가작업 그리고 45개의 파일을 삭제
  1. 6 32
      contrib/completion/bash/docker
  2. 5 13
      contrib/completion/zsh/_docker

+ 6 - 32
contrib/completion/bash/docker

@@ -1832,24 +1832,17 @@ _docker_swarm() {
 
 
 _docker_swarm_init() {
 _docker_swarm_init() {
 	case "$prev" in
 	case "$prev" in
-		--auto-accept)
-			COMPREPLY=( $( compgen -W "manager none worker" -- "$cur" ) )
-			return
-			;;
 		--listen-addr)
 		--listen-addr)
 			if [[ $cur == *: ]] ; then
 			if [[ $cur == *: ]] ; then
 				COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
 				COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
 			fi
 			fi
 			return
 			return
 			;;
 			;;
-		--secret)
-			return
-			;;
 	esac
 	esac
 
 
 	case "$cur" in
 	case "$cur" in
 		-*)
 		-*)
-			COMPREPLY=( $( compgen -W "--auto-accept --force-new-cluster --help --listen-addr --secret" -- "$cur" ) )
+			COMPREPLY=( $( compgen -W "--force-new-cluster --help --listen-addr" -- "$cur" ) )
 			;;
 			;;
 	esac
 	esac
 }
 }
@@ -1870,7 +1863,7 @@ _docker_swarm_inspect() {
 
 
 _docker_swarm_join() {
 _docker_swarm_join() {
 	case "$prev" in
 	case "$prev" in
-		--ca-hash|--secret)
+		--token)
 			return
 			return
 			;;
 			;;
 		--listen-addr)
 		--listen-addr)
@@ -1883,7 +1876,7 @@ _docker_swarm_join() {
 
 
 	case "$cur" in
 	case "$cur" in
 		-*)
 		-*)
-			COMPREPLY=( $( compgen -W "--ca-hash --help --listen-addr --manager --secret" -- "$cur" ) )
+			COMPREPLY=( $( compgen -W "--help --listen-addr --token" -- "$cur" ) )
 			;;
 			;;
 		*:)
 		*:)
 			COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
 			COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
@@ -1901,25 +1894,20 @@ _docker_swarm_leave() {
 
 
 _docker_swarm_update() {
 _docker_swarm_update() {
 	case "$prev" in
 	case "$prev" in
-		--auto-accept)
-			COMPREPLY=( $( compgen -W "manager none worker" -- "$cur" ) )
-			return
-			;;
-		--cert-expiry|--dispatcher-heartbeat|--secret|--task-history-limit)
+		--cert-expiry|--dispatcher-heartbeat|--task-history-limit)
 			return
 			return
 			;;
 			;;
 	esac
 	esac
 
 
 	case "$cur" in
 	case "$cur" in
 		-*)
 		-*)
-			COMPREPLY=( $( compgen -W "--auto-accept --cert-expiry --dispatcher-heartbeat --help --secret --task-history-limit" -- "$cur" ) )
+			COMPREPLY=( $( compgen -W "--cert-expiry --dispatcher-heartbeat --help --task-history-limit" -- "$cur" ) )
 			;;
 			;;
 	esac
 	esac
 }
 }
 
 
 _docker_node() {
 _docker_node() {
 	local subcommands="
 	local subcommands="
-		accept
 		demote
 		demote
 		inspect
 		inspect
 		ls list
 		ls list
@@ -1940,16 +1928,6 @@ _docker_node() {
 	esac
 	esac
 }
 }
 
 
-_docker_node_accept() {
-	case "$cur" in
-		-*)
-			COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
-			;;
-		*)
-			__docker_complete_nodes --id --filter membership=pending
-	esac
-}
-
 _docker_node_demote() {
 _docker_node_demote() {
 	case "$cur" in
 	case "$cur" in
 		-*)
 		-*)
@@ -2072,10 +2050,6 @@ _docker_node_update() {
 			COMPREPLY=( $( compgen -W "active drain pause" -- "$cur" ) )
 			COMPREPLY=( $( compgen -W "active drain pause" -- "$cur" ) )
 			return
 			return
 			;;
 			;;
-		--membership)
-			COMPREPLY=( $( compgen -W "accepted rejected" -- "$cur" ) )
-			return
-			;;
 		--role)
 		--role)
 			COMPREPLY=( $( compgen -W "manager worker" -- "$cur" ) )
 			COMPREPLY=( $( compgen -W "manager worker" -- "$cur" ) )
 			return
 			return
@@ -2087,7 +2061,7 @@ _docker_node_update() {
 
 
 	case "$cur" in
 	case "$cur" in
 		-*)
 		-*)
-			COMPREPLY=( $( compgen -W "--availability --help --label-add --label-rm --membership --role" -- "$cur" ) )
+			COMPREPLY=( $( compgen -W "--availability --help --label-add --label-rm --role" -- "$cur" ) )
 			;;
 			;;
 		*)
 		*)
 			__docker_complete_nodes
 			__docker_complete_nodes

+ 5 - 13
contrib/completion/zsh/_docker

@@ -782,7 +782,6 @@ __docker_complete_worker_nodes() {
 __docker_node_commands() {
 __docker_node_commands() {
     local -a _docker_node_subcommands
     local -a _docker_node_subcommands
     _docker_node_subcommands=(
     _docker_node_subcommands=(
-        "accept:Accept a node in the swarm"
         "demote:Demote a node as manager in the swarm"
         "demote:Demote a node as manager in the swarm"
         "inspect:Display detailed information on one or more nodes"
         "inspect:Display detailed information on one or more nodes"
         "ls:List nodes in the swarm"
         "ls:List nodes in the swarm"
@@ -802,7 +801,7 @@ __docker_node_subcommand() {
     opts_help=("(: -)--help[Print usage]")
     opts_help=("(: -)--help[Print usage]")
 
 
     case "$words[1]" in
     case "$words[1]" in
-        (accept|rm|remove)
+        (rm|remove)
              _arguments $(__docker_arguments) \
              _arguments $(__docker_arguments) \
                 $opts_help \
                 $opts_help \
                 "($help -)*:node:__docker_complete_pending_nodes" && ret=0
                 "($help -)*:node:__docker_complete_pending_nodes" && ret=0
@@ -854,7 +853,6 @@ __docker_node_subcommand() {
                 "($help)--availability=[Availability of the node]:availability:(active pause drain)" \
                 "($help)--availability=[Availability of the node]:availability:(active pause drain)" \
                 "($help)*--label-add=[Add or update a node label]:key=value: " \
                 "($help)*--label-add=[Add or update a node label]:key=value: " \
                 "($help)*--label-rm=[Remove a node label if exists]:label: " \
                 "($help)*--label-rm=[Remove a node label if exists]:label: " \
-                "($help)--membership=[Membership of the node]:membership:(accepted rejected)" \
                 "($help)--role=[Role of the node]:role:(manager worker)" \
                 "($help)--role=[Role of the node]:role:(manager worker)" \
                 "($help -)1:node:__docker_complete_nodes" && ret=0
                 "($help -)1:node:__docker_complete_nodes" && ret=0
             ;;
             ;;
@@ -1205,11 +1203,9 @@ __docker_swarm_subcommand() {
         (init)
         (init)
             _arguments $(__docker_arguments) \
             _arguments $(__docker_arguments) \
                 $opts_help \
                 $opts_help \
-                "($help)--auto-accept=[Acceptance policy]:policy:(manager none worker)" \
                 "($help)*--external-ca=[Specifications of one or more certificate signing endpoints]:endpoint: " \
                 "($help)*--external-ca=[Specifications of one or more certificate signing endpoints]:endpoint: " \
                 "($help)--force-new-cluster[Force create a new cluster from current state]" \
                 "($help)--force-new-cluster[Force create a new cluster from current state]" \
-                "($help)--listen-addr[Listen address]:ip\:port: " \
-                "($help)--secret[Set secret value needed to accept nodes into cluster]:secret: " && ret=0
+                "($help)--listen-addr=[Listen address]:ip\:port: " && ret=0
             ;;
             ;;
         (inspect)
         (inspect)
             _arguments $(__docker_arguments) \
             _arguments $(__docker_arguments) \
@@ -1219,10 +1215,8 @@ __docker_swarm_subcommand() {
         (join)
         (join)
             _arguments $(__docker_arguments) \
             _arguments $(__docker_arguments) \
                 $opts_help \
                 $opts_help \
-                "($help)--ca-hash=[Hash of the Root Certificate Authority certificate used for trusted join]:hash: " \
-                "($help)--listen-addr[Listen address]:ip\:port: " \
-                "($help)--manager[Try joining as a manager]" \
-                "($help)--secret[Secret for node acceptance]:secret: " \
+                "($help)--listen-addr=[Listen address]:ip\:port: " \
+                "($help)--token=[Token for entry into the swarm]:secret: " \
                 "($help -):host\:port: " && ret=0
                 "($help -):host\:port: " && ret=0
             ;;
             ;;
         (leave)
         (leave)
@@ -1232,11 +1226,9 @@ __docker_swarm_subcommand() {
         (update)
         (update)
             _arguments $(__docker_arguments) \
             _arguments $(__docker_arguments) \
                 $opts_help \
                 $opts_help \
-                "($help)--auto-accept=[Acceptance policy]:policy:(manager none worker)" \
                 "($help)--cert-expiry=[Validity period for node certificates]:duration: " \
                 "($help)--cert-expiry=[Validity period for node certificates]:duration: " \
                 "($help)--dispatcher-heartbeat=[Dispatcher heartbeat period]:duration: " \
                 "($help)--dispatcher-heartbeat=[Dispatcher heartbeat period]:duration: " \
-                "($help)--secret[Set secret value needed to accept nodes into cluster]:secret: " \
-                "($help)--task-history-limit[Task history retention limit]:limit: " && ret=0
+                "($help)--task-history-limit=[Task history retention limit]:limit: " && ret=0
             ;;
             ;;
         (help)
         (help)
             _arguments $(__docker_arguments) ":subcommand:__docker_network_commands" && ret=0
             _arguments $(__docker_arguments) ":subcommand:__docker_network_commands" && ret=0