Commit Graph

19 Commits

Author SHA1 Message Date
Stephen Kitt cfd2169f88 cli: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 45836971f27ca70cd7742e8ee66e99e3c648cf9f
2023-03-14 16:17:48 +01:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03: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
Brian Pursley 96fc22ebfb Revert "Remove unused flags from kubectl run"
Kubernetes-commit: eae2c424efd9dda8cb0f5ba01ab4c955cdf42cfa
2022-09-05 09:34:48 -04:00
Brian Pursley 7a7b2a177c Remove unused flags from kubectl run
The following flags, which do not apply to kubectl run,
have been removed:
--cascade
--filename
--force
--grace-period
--kustomize
--recursive
--timeout
--wait

These flags were being added to the run command to support
pod deletion after attach, but they are not used if set, so
they effectively do nothing.

This PR also displays an error message if the pod fails to be
deleted (when the --rm flag is used).  Previously any error
during deletion would be suppressed and the pod would remain.

This PR also adds some unit tests for run and attach with and
without the --rm flag.  As such, some minor refactoring of the
run command has been done to support mocking dependencies.

Kubernetes-commit: 25e713ba777ec1158fad749e9467601526ba096a
2022-06-21 10:51:30 -04:00
brianpursley 07f77100fc Add --override-type flag to kubectl run and kubectl expose to allow the choice of using a JSON Patch or Strategic Merge Patch to apply the override to the generated output.
Kubernetes-commit: 0e697e19ac9f73e2efa0e60157730ba8731e3847
2021-11-05 07:10:47 -04:00
Maciej Szulik 1198e26232 Drop deprecated run flags and deprecate unused ones
Kubernetes-commit: f38ef2fbc6299f4b050a0daa578bfbf393df467c
2021-03-03 22:22:58 +01:00
Jan Chaloupka 6fea4885d8 kubectl/pkg/cmd tests: set explicit namespace
Otherwise, the namespace gets set to what's a current namespace
in provided kubeconfig. Which can be different from default.

Kubernetes-commit: d4e89547f065ac5eee67ab4646fb3cee874dc1a9
2020-11-20 19:09:54 +01:00
zhouya0 8411619cbf Support kubectl delete foreground
Kubernetes-commit: 383b5f676670d99dc1fba4254ba7f6a81a052ba3
2020-07-23 18:45:59 +08:00
Adrian Smith e8b951b248 Add unit test to kubectl/cmd/run
This test verifies that adding the "expose" parameter results in a
service being created for the pod.

Kubernetes-commit: c5c48c96804a6dd47cb8fbac25280f3b456f1cae
2020-06-15 20:25:45 +01:00
zhouya0 2b8a7e264f Remove kubectl run validate replicas logic
Kubernetes-commit: 4b82d5ae084719e5ff5e1d6a5036452eb91f4099
2020-06-16 17:01:33 +08:00
zhouya0 4a94a16b14 Fix kubectl run ignore namespace
Kubernetes-commit: b3c830d4bf260c68d4299cd1879dbe9ce9913bc6
2020-05-04 22:35:03 +08:00
Julian V. Modesto f9460c5333 Use --dry-run=client,server in kubectl.
- Support --dry-run=server for subcommands apply, run, create, annotate,
expose, patch, label, autoscale, apply set-last-applied, drain, rollout undo
- Support --dry-run=server for set subcommands
  - image
  - resources
  - serviceaccount
  - selector
  - env
  - subject
- Support --dry-run=server for create subcommands.
  - clusterrole
  - clusterrolebinding
  - configmap
  - cronjob
  - job
  - deployment
  - namespace
  - poddisruptionbudget
  - priorityclass
  - quota
  - role
  - rolebinding
  - service
  - secret
  - serviceaccount
- Remove GetClientSideDryRun

Kubernetes-commit: 13b80b48cd02b8263d910f2423a1f5b92cdf7644
2020-01-30 20:23:33 -05:00
Maciej Szulik c6c7c0dfb8 Remove kubectl run generators
Kubernetes-commit: 82f97775b7c2317a8ca45e616a09e447da987ab2
2020-01-09 17:09:51 +01:00
Clayton Coleman 4ca8f5ecfe test: kubectl unit tests should be using codecs without conversion
Tests are also refactored to use the simpler RESTClient code path.

Kubernetes-commit: 8a9b8c87c40ee65751828d9dd02f4f642588f0ce
2019-11-03 15:20:10 -05:00
clarklee92 87db492820 Modify the status code number to HTTP status semantics
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>

Kubernetes-commit: f86f5ee14ef3c8adf9855ce16dcc57beca949719
2019-11-06 00:45:35 +08: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