Commit Graph

19 Commits

Author SHA1 Message Date
Sean Sullivan 969a47ceed StreamTranslator and FallbackExecutor for WebSockets
Kubernetes-commit: 168998e87bfd49a1b0bc6402761fafd5ace3bb3b
2023-07-06 21:22:07 -07:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
arkbriar d17f0318cc Support cancelable SPDY executor stream
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
2022-08-24 10:21:35 +08:00
Lee Verberne 3e07021378 Fix incorrect message when attaching to ephemeral containers
Kubernetes-commit: 8d4ec9ac9dcf45b66111075a1b67043c2885b263
2022-07-15 19:23:24 +02:00
Marc Khouzam cd5b039b42 Refactor completion code into its own package
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: c4f8c57b43843abd13bae677b73c622e1c30b46f
2022-03-24 09:06:05 -04:00
Marc Khouzam cd245d2e22 Support completion for the <type>/<name> form
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
2022-03-01 10:45:59 -05:00
Andrea Hoffer 09ed00ef49 Minor adjustments to descriptions and example text
Kubernetes-commit: 6b736f348483bb6b20d4633319305960f4d9e4c1
2021-07-06 15:05:26 -04:00
Marc Khouzam 5c679b006e Join common functions for completion
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 9625872d1e4fd0d4d397b3ab732c6969a3a376fe
2021-05-15 21:22:42 -04:00
Marc Khouzam 1946af5761 Move all completion bash code to Go code
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 879cdc5fa9e518ce76b9e1dc7e795132457966f3
2021-03-05 15:43:31 -05:00
mengjiao.liu a0af655b7a kubectl default container behavior
Kubernetes-commit: 88e530117ff3fff29e670aee51c677a8e0fe8dec
2021-03-05 17:04:40 +08:00
Clayton Coleman 56434236a4 kubectl: Inline the containers for the user in attach/exec
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
2021-02-11 11:40:25 -05:00
Clayton Coleman 46f90dca38 kubectl: Properly respect --quiet in exec/attach
--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
2021-02-11 11:48:43 -05:00
Karl 'NaN' Wikström 38408eaa8c cleanup: use i18n.T on all command descriptions
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
2020-10-09 13:16:13 +02:00
weihan a693563834 better understanding of kubectl attach description
Kubernetes-commit: 4fc4eb0c91b17a438e4ef56215b275e242433c59
2020-05-11 10:12:48 +08:00
Davanum Srinivas 445ad1366b switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Lee Verberne 8408ed1e0b Allow kubectl to attach to an ephemeral container
Kubernetes-commit: 5bd8a045d651005cd8cb1d34d835fdb487651325
2018-04-13 16:55:15 +02:00
Sean Sullivan 1483769081 Update gofmt
Kubernetes-commit: e2cae2344486af198f8ab38e4dd97d4f24dfd190
2019-08-01 13:14:06 -07:00
Sean Sullivan 5b48717f2d Update import statements to reflect code move
Kubernetes-commit: acece3c2964115a4f29a43e368ad5de59dbbc258
2019-08-01 11:10:05 -07:00
Sean Sullivan c6063dd846 Move pkg/kubectl/cmd/{command} to staging
Kubernetes-commit: 0e0ea523392f1121f61f99ac30a9bc2043eaed90
2019-08-01 11:01:40 -07:00