Merge pull request #13089 from JanetKuo/kubectl-exec-bash-completion
Enable kubectl exec pod name bash completion
This commit is contained in:
		| @@ -181,6 +181,11 @@ __kubectl_get_resource() | |||||||
|     __kubectl_parse_get "${nouns[${#nouns[@]} -1]}" |     __kubectl_parse_get "${nouns[${#nouns[@]} -1]}" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | __kubectl_get_resource_pod() | ||||||
|  | { | ||||||
|  |     __kubectl_parse_get "pod" | ||||||
|  | } | ||||||
|  |  | ||||||
| # $1 is the name of the pod we want to get the list of containers inside | # $1 is the name of the pod we want to get the list of containers inside | ||||||
| __kubectl_get_containers() | __kubectl_get_containers() | ||||||
| { | { | ||||||
| @@ -220,6 +225,10 @@ __custom_func() { | |||||||
|             __kubectl_require_pod_and_container |             __kubectl_require_pod_and_container | ||||||
|             return |             return | ||||||
|             ;; |             ;; | ||||||
|  |         kubectl_exec) | ||||||
|  |             __kubectl_get_resource_pod | ||||||
|  |             return | ||||||
|  |             ;; | ||||||
|         *) |         *) | ||||||
|             ;; |             ;; | ||||||
|     esac |     esac | ||||||
|   | |||||||
| @@ -47,6 +47,11 @@ __kubectl_get_resource() | |||||||
|     __kubectl_parse_get "${nouns[${#nouns[@]} -1]}" |     __kubectl_parse_get "${nouns[${#nouns[@]} -1]}" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | __kubectl_get_resource_pod() | ||||||
|  | { | ||||||
|  |     __kubectl_parse_get "pod" | ||||||
|  | } | ||||||
|  |  | ||||||
| # $1 is the name of the pod we want to get the list of containers inside | # $1 is the name of the pod we want to get the list of containers inside | ||||||
| __kubectl_get_containers() | __kubectl_get_containers() | ||||||
| { | { | ||||||
| @@ -86,6 +91,10 @@ __custom_func() { | |||||||
|             __kubectl_require_pod_and_container |             __kubectl_require_pod_and_container | ||||||
|             return |             return | ||||||
|             ;; |             ;; | ||||||
|  |         kubectl_exec) | ||||||
|  |             __kubectl_get_resource_pod | ||||||
|  |             return | ||||||
|  |             ;; | ||||||
|         *) |         *) | ||||||
|             ;; |             ;; | ||||||
|     esac |     esac | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Nikhil Jindal
					Nikhil Jindal