mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Fix wrong completion for kubectl attach
Although `kubectl attach POD_NAME <tab>` completes container name, kubectl attach needs `-c` option so the command causes error as: ``` $ kubectl attach nginx-7cdbd8cdc9-b5rhr nginx error: the server doesn't have a resource type "nginx-7cdbd8cdc9-b5rhr" ``` This patch changes the completion to the same way as `kubectl exec`.
This commit is contained in:
		@@ -248,11 +248,11 @@ __custom_func() {
 | 
				
			|||||||
            __kubectl_get_resource
 | 
					            __kubectl_get_resource
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        kubectl_logs | kubectl_attach)
 | 
					        kubectl_logs)
 | 
				
			||||||
            __kubectl_require_pod_and_container
 | 
					            __kubectl_require_pod_and_container
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        kubectl_exec | kubectl_port-forward | kubectl_top_pod)
 | 
					        kubectl_exec | kubectl_port-forward | kubectl_top_pod | kubectl_attach)
 | 
				
			||||||
            __kubectl_get_resource_pod
 | 
					            __kubectl_get_resource_pod
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user