Commit Graph

25 Commits

Author SHA1 Message Date
Arda Güçlü 2c705c6f91 Increate timeout to 10sec and shortcut when ctx deadline is exceeded
Kubernetes-commit: ca2c9c64b489d14352e9b6f4c827506a5653a569
2024-08-16 16:13:01 +03:00
Benjamin Elder ee337ad2d6 kuebctl cp: discard output from test command
we only care about the exit code

see https://github.com/kubernetes/kubernetes/issues/126669

Kubernetes-commit: 78ae67a90042aa6ed5e91fc5730c10f26ba8d7f6
2024-08-14 16:58:02 -07:00
Arda Güçlü 4fe61440d3 Add timeout cancellation to kubectl cp destination path check
Kubernetes-commit: d981b19ad30c3396e8a4d197bedc346e68e0270b
2024-08-13 11:02:04 +03:00
calvin 9a67ed3d47 cleanup the retrun style for cp execute function
Signed-off-by: calvin <wen.chen@daocloud.io>

Kubernetes-commit: 6e0ece85c49462c40221cb4e322197dbbcdc8fd4
2023-10-07 19:05:50 +08:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
Brian Pursley a2ae001d8e cmd/get: Remove cmd argument from Run()
Removes the need to pass cmd as an argument to Run(). This change required reading the --sort-by flag in Complete() in a way similar to other flags.

This change allows the cobra.Command not to need to be passed throughout the completion code, which I updated as part of this commit.

It also is a step in the direction of the TODO comment requesting the removal of arguments passed to Run() and watch().

Kubernetes-commit: aa7a828f20b479a8a943d897224e8e76c3bb6cff
2022-12-23 14:56:59 -05:00
inosato 8272d71ba6 Remove ioutil from kubectl
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 774ab1349bfd553c97a99b992e9f38659f541c84
2022-07-30 22:31:16 +09:00
wujunwei be20835e90 kubectl: remove unnecessary TODO annotations
Kubernetes-commit: 2afc78bac870286aa4f39069fb5ab3fa13a134ed
2022-11-17 09:39:30 +08:00
Arda Güçlü 81a25f37b5 Set validate functions requiring no parameters for all commands
Validate function is used to validate command options and should not get
any additional parameter. To preserve compatibility across all
kubectl commands, this PR removes all parameters in validate functions.

Kubernetes-commit: 8fb423bfabe0d53934cc94c154c7da2dc3ce1332
2022-05-17 11:38:20 +03:00
Filip Křepinský 0636d103cb resume kubectl cp with tail when --retries is negative
- count retries from 1 when printing info for users

Kubernetes-commit: a81f674a05a5747df1109ed3e572042caf6d607b
2022-03-16 19:59:39 +01: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
Matthias Bertschy 68250fd482 add option to make kubectl cp resume on errors
Kubernetes-commit: 00b528cdf42ae4c1771f3a51c557a1f289701113
2021-09-06 10:04:15 +02:00
Maciej Szulik fe89be9c6f Use separate pathSpec for local and remote to properly handle cleaning paths
Kubernetes-commit: 0fb6815f08f39c8af814fa733d5235681a124b81
2020-08-21 19:24:19 +02:00
Andrea Hoffer 09ed00ef49 Minor adjustments to descriptions and example text
Kubernetes-commit: 6b736f348483bb6b20d4633319305960f4d9e4c1
2021-07-06 15:05:26 -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
changshuchao 7d1600ce5a code cleanup for kubectl apply_edit_last_applied.go,wait.go,completion.go,cp.go
Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>

Kubernetes-commit: e229ca33cff782e0bf602f43312b9a168aa58c4c
2021-03-07 05:04:30 +08:00
mengjiao.liu a0af655b7a kubectl default container behavior
Kubernetes-commit: 88e530117ff3fff29e670aee51c677a8e0fe8dec
2021-03-05 17:04:40 +08:00
mengjiao.liu 0a33eeb176 update kubectl cp --container flag description
Kubernetes-commit: 6be7b00b455f632a92c2c9c1a3878ecf5201e955
2021-03-01 18:02:02 +08:00
Bilal Amarni aa373084bf [kubectl] Fail when local source file doesn't exist
When trying to upload an unexisting file to a pod,
kubectl currently doesn't print any error message
and terminates with a zero exit code.

This adds a check and fails explicitly in such cases.

Kubernetes-commit: 3fa5b504423f169723b911547cd22ae85da168e0
2020-04-22 11:09:41 +02: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
knight42 0597d045eb refactor: move kubectl-cp to staging
Signed-off-by: knight42 <anonymousknight96@gmail.com>

Kubernetes-commit: 1b32dfdafdcd6cce21415c75385970a9ae5b0f01
2020-06-15 12:20:14 +08:00
Maciej Szulik b567e802b1 Move kubectl cp back to k/k
Kubernetes-commit: ab1c56ae87780a390bd31d50558e4e44bca551dc
2019-08-28 19:01:25 +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