* Remove deprecated kubectl exec command execution without dash
* Use command execution with dash in kubectl exec
* Modify unit tests to only use command after dash
Kubernetes-commit: 6f4e97e905e5553e75a5a8c042c9f5a29bd1b78d
`kubectl exec` command supports getting files as inputs. However,
if the file contains multiple resources, it returns unclear error message;
`cannot attach to *v1.List: selector for *v1.List not implemented`.
Since `exec` command does not support multi resources, this PR
handles that and returns descriptive error message earlier.
Kubernetes-commit: 832644f0b38d536be7a5adce9bc62b0902710091
Mark remotecommand.Executor as deprecated and related modifications.
Handle crash when streamer.stream panics
Add a test to verify if stream is closed after connection being closed
Remove blank line and update waiting time to 1s to avoid test flakes in CI.
Refine the tests of StreamExecutor according to comments.
Remove the comment of context controlling the negotiation progress and misc.
Signed-off-by: arkbriar <arkbriar@gmail.com>
Kubernetes-commit: 42808c8343671e6783ba4c901dcd619bed648c3d
This commit teaches the shell completion logic how to handle the
<type>/<name> form for resource specification.
It also teaches the 'exec' command how to complete its '--container/-c'
flag using container names.
Also, for commands that work on pods, kubectl will now also suggest
completion choices of the form <type>/<name> for resource types that
contain pods (see below for more details).
The following commands can now have completion of the <type>/<name>
form. Commands that accept any resource type:
annotate
apply edit-last-applied
apply view-last-applied
delete
describe
edit
get
label
patch
Commands that accept a subset of resource types:
autoscale
expose
rollout history
rollout pause
rollout restart
rollout resume
rollout status
rollout undo
scale
taint
Commands that apply to resource types that contain pods:
attach
exec
logs
port-foward
For these last four commands, the possible resource types are now
included in the completion choices. For example:
kubectl exec d<TAB>
will suggest
daemonsets/ deployments/
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Kubernetes-commit: cf66f5c3cbd0a0e2f223af438ee4c6bc7e4a907c
The behavior of the container defaulting in attach/exec is inconsistent
and should be unified. As a user, when we default the vast majority of
pods will have a small number of containers and so printing the container
names inline (as kubectl logs did) is more appropriate. The debug message
we printed about using describe was already longer than 99% of all pod
container names, so we were wasting user time.
Unify container selection for exec and attach to be consistent with old
behavior. Properly handle the --quiet flag (should not print in that case)
for both commands. Remove EnableCmdSuggestion and the machinery it needs.
The message now prints:
> Defaulted container "etcdctl" out of: etcdctl, etcd, etcd-metrics, etcd-ensure-env-vars (init), etcd-resources-copy (init)
Kubernetes-commit: 43e8ebbbcd3f57d18d8151efb6242f88a763b06d
--quiet means no informational output for the human that could be
confused with the output of the shell / command on the other side.
Kubernetes-commit: 75700d32bff0e28c7093ef384de78dbdd0db61b2
- update according to KEP: move getContainerName to helper
Signed-off-by: pacoxu <paco.xu@daocloud.io>
Kubernetes-commit: b54e823dbce08bff6fab979243663b0fea5a351f
cleanup: use i18n.T only on string literals
cleanup: sort imports
Add i18n dependency for wait.go
Remove translation on envResource
cleanup: translate string instead of variable
cleanup: sort imports
cleanup: translate string literal only
Kubernetes-commit: cc8428566ea7160c5b20410a1bee53ca7ddb998e