Commit Graph

103 Commits

Author SHA1 Message Date
Julian V. Modesto b6cbb3bd6c Clean up --dry-run values.
- Clean up --dry-run values in tests, docs, and scripts
- Fix --dry-run for auth reconcile and add a test

Kubernetes-commit: d97169f59ad11f2d2ffd8ef14446bbec5ffc881b
2020-02-13 16:28:22 -05:00
Brian Pursley 04c3dd17ff Default grace period to 0 when --force is used to delete an object
Kubernetes-commit: 0f31bef94c46b735bb7b1fe2a7d49d58fb93ed11
2020-02-24 09:30:56 -05:00
Cornelius Weig e54c7dba6a Add documentation around plugins
Documentation is added in several areas:
1. `kubectl plugin` now prints a note that plugins are best discovered
   with krew.dev and how to install it.
2. The kubectl book now has a new section about plugins, featuring
   - a very brief introduction to the kubectl plugin mechanism
   - a section about krew

Kubernetes-commit: ed0e0350854e34bad65de4db44c0f661a5851870
2020-02-26 14:50:50 +01:00
zhouya0 d23f51983a Add init containers to dump info
Kubernetes-commit: a024ac14ef14da1c972edc6589de81405f17bc76
2020-02-19 20:47:34 +08:00
Julian V. Modesto d3af7e0862 Remove deprecated rolling-update command
Kubernetes-commit: 932500c0151a4f0926cf07e63068248540b22f90
2020-02-11 23:27:01 -05:00
Julian V. Modesto 9c1c5e4f10 Add --dry-run to more kubectl commands.
- delete
- taint
- replace

Kubernetes-commit: a9ec444d743940fd93b31313a6f3f857e5c5f048
2020-02-18 18:08:25 -05:00
zhouya0 dcc99c8f57 optimize kubectl version help info
Kubernetes-commit: f85e079147b65fe444ee60b9c302173ae169990a
2020-02-19 16:45:37 +08:00
Julian V. Modesto 9c04919f3b Error if --local and --dry-run=server are passed
Kubernetes-commit: 5fcd9c7c7ec432dd27e770e49e0e6872335c765d
2020-02-13 16:44:14 -05:00
Hidetake Iwata 0f70b0c27b Fix example of kubectl config set-credentials
Kubernetes-commit: 0368a7d5f7acea476f4adcd85ea037cfe24ccd3f
2020-02-12 21:11:24 +09:00
Olivier Lemasle e7018f8673 kubectl cluster-info dump: use file extension according to output format
Kubernetes-commit: d6fcc224f17f2fe4bb45e731ea3d50a26539fc54
2019-08-28 11:51:39 +02: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 e10402e591 Don't show flags in api-versions help
Kubernetes-commit: 8ff6b24c5736d7b2ce31319ae950a806f2325327
2020-02-12 18:31:05 +01:00
gavinfish 275513cb52 Staticcheck: vendor/k8s.io/kubectl/pkg/scale|describe/versioned|cmd/top|cmd/util/editor|cmd/top
Kubernetes-commit: f4940cf55fd7c2787b370464d491a764c4febd78
2020-01-21 10:13:10 +08:00
zhouya0 94b91c1d51 fix kubectl drain ignore daemonsets and others
Kubernetes-commit: e3c8add683a095f1bffef1b0ca413f1e42be7fe0
2020-01-19 14:28:53 +08:00
zhouya0 9c14935e27 Add kubectl diff exit code doc
Kubernetes-commit: 527e66fc2829917444d874771142fdd834feb8d6
2020-02-04 17:22:23 +08:00
Brian Pursley 09eaf230cc Fixed code formatting issues discovered by verify-gofmt
Kubernetes-commit: 78248d0c2aaca258b4210446dc38c096e83a1eb6
2020-02-04 10:11:18 -05:00
Brian Pursley 445baa99d2 Added 'No resources found' message to describe and top pod commands
Kubernetes-commit: e70a630dac6c0158a5f9bb571223ed5759096dc1
2020-01-24 10:42:08 -05:00
Odin Ugedal 4e367c0f16 Add error check in kubectl proxy on server setup
If "NewServer" returns an error, it will result in a nil pointer
dereference segfault.

A simple way to test the behavior is to prefix the server url with a
colon, ":".

Kubernetes-commit: 1e50bc2d094410f3848b4dbc5f0442440d8f7d77
2019-07-26 20:06:46 +02:00
Mike Danese 29cd24b6cc generated: run refactor
Kubernetes-commit: 25651408aeadf38c3df7ea8c760e7519fd37d625
2020-02-08 12:30:21 -05:00
Mike Danese 71d8052cb0 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Brian Pursley 1777c19079 Fixed code formatting issues discovered by verify-gofmt
Kubernetes-commit: 2d21f16c38e704eaaa42d7d583ddd103c16d0d6b
2020-02-04 10:16:06 -05:00
Brian Pursley e9f1eb93f4 Fixed problem in unit test where error expected/actual comparison was not being performed
Kubernetes-commit: 97185e97529ef7c006f26bb3190805ad28f15ffe
2020-02-03 12:17:51 -05:00
Brian Pursley b69c2a4389 Removed unneeded newline (moved to end of directory not found message)
Kubernetes-commit: 48ee18b516b267ba062a1dd00a21e7ae10ecd805
2020-01-28 20:51:24 -05:00
Brian Pursley 346cf3d4f4 Ignore empty or blank string in path when listing plugins
Kubernetes-commit: f60c0af97710a5dca6f55f3c4a1480412ad50ec8
2020-01-28 17:04:31 -05:00
wojtekt 4f3723dc40 Register conversions for kubectl testing types
Kubernetes-commit: ea140f5e1a1a297e251cc28a40e2bbf77dfd02e4
2020-01-09 14:16:33 +01:00
Tim Allclair 6fca42a14a Ensure testing credentials are labeled as such
Kubernetes-commit: 9d3670f3586c98c02cdca93b7c98dd91fc0b87bd
2020-02-04 10:36:05 -08:00
Antoine Pelisse 4c36396b35 kubectl-diff: Return non-1 errors on kubectl failures
Currently, diff AND kubectl can return 1 errors either when diff finds
differences, or when kubectl fails something. It also prints an ugly
error when diff finds a differences, since 1 is treated as an error.

Two things this PR does:

1. If diff returns 1, then do not treat it as an error, and exit with
exit code 1. It no longer prints the ugly error.

2. Kubectl errors are +1'd so that they never return 1 which shouldn't
be considered an error.

We need to update the documentation accordingly, to mention that
`KUBECTL_EXTERNAL_DIFF` programs must also follow the convention of
using one as their exit code for changes detected.

Kubernetes-commit: f2b21f08d95291212ba8987aa9d446c02a96089a
2020-01-21 13:52:41 -08:00
Julian V. Modesto c0b11fa131 Extend --dry-run to support string values.
* Extend --dry-run to support string values for dry run strategies
  'client', 'server', and 'none'
* Ensure --dry-run is set and accessed via cmdutil
* Deprecate --dry-run (unset), --dry-run=true, and --dry-run=false

Kubernetes-commit: af52beda260257e81cc9e19e9e5108b682ee93d6
2019-12-15 18:29:27 -05:00
Mike Danese 4524edecce cleanup req.Context() and ResponseWrapper
Kubernetes-commit: 968adfa99362f733ef82f4aabb34a59dbbd6e56a
2020-01-27 18:52:27 -08:00
Maciej Szulik c6c7c0dfb8 Remove kubectl run generators
Kubernetes-commit: 82f97775b7c2317a8ca45e616a09e447da987ab2
2020-01-09 17:09:51 +01:00
Maciej Szulik 72f1da0b87 Fix kubectl taint's Complete parsing
Kubernetes-commit: 6972d6f33af6b04a9f436fc0858b27d3b9249ea2
2020-01-21 14:36:16 +01:00
Julian V. Modesto a3f7877cd1 Support DryRun in cli-runtime REST Helper.
- Move TestSupportsDryRun to cli-runtime
- Move TestDryRunVerifier to cli-runtime
- Add OpenAPI schema for testdata to cli-runtime
- Use Helper.DryRun and DryRunVerifier for Apply
- Add WithOptions methods to Helper

Kubernetes-commit: 6bea0e469bcfe4967cbf2656a998d60e0b684747
2019-12-18 22:00:34 -05:00
Antoine Pelisse 104e4d1e7a Improve error message when diff binary is not in PATH
Kubernetes-commit: c1a4cd9c75b4ed476ec3ed1b27a785dd1685a6e3
2020-01-17 16:17:41 -08:00
martinkaburu 50f26dd951 fix apply --prune to check cli specified namespace
Kubernetes-commit: f2518347f3dbe36586367c94aa98d5096f74a742
2019-11-25 23:21:43 +03:00
Name Surname b21179860f Fix kubectl top sort-by cpu and sort-by memory options
Kubernetes-commit: 824af9e3072d9d68071fec291ac3f5f89362e4ab
2019-09-04 16:28:21 +02:00
yuzhiquan baaee7d515 cleanup(kubectl taint): fix Errorf and comment error, and remove unnecessary bool flag
Kubernetes-commit: 87e8137c18ab27308617e83a18fde5de3edc64d7
2019-12-17 19:41:18 +08:00
Maciej Szulik 51c0d83068 Allow embedding logs command
Kubernetes-commit: 925be295fb09655ae668842e42aab2ea919c5ef2
2020-01-13 14:54:54 +01:00
zhouya0 cbbf8d8bf6 fix kubectl annotate local error
Kubernetes-commit: 568edf72ec1fc10368a19be8184b201265e6c39e
2020-01-08 17:10:08 +08:00
zhouya0 65d1aa5d00 fix apply set last applied namespace
Kubernetes-commit: 4291a03e39559d10eab0253f9cd431d6a375e235
2019-12-20 16:09:49 +08:00
danielqsj 4b914450ab unify alias of api errors under pkg and staging
Kubernetes-commit: 5bc0e26c1902e7e28abfc828de19a2dbb3e492c2
2019-11-12 16:26:59 +08:00
hbceylan f0cc26a729 fix kubectl run help image name
Kubernetes-commit: 5b4a7744fad614732de87e032f5d4dba743fddf9
2019-12-23 21:49:37 +00:00
Sean Sullivan 2598a9eb6d Adds PreProcessor and PostProcessor functions for modifying apply behavior
Kubernetes-commit: 79bc63fb4b79caea4b141d318b11a0892ca14c95
2019-12-17 14:58:54 -08:00
Sean Sullivan 641631dfad Moves visitedUids and visitedNamespaces (used for pruning) into ApplyOptions
Kubernetes-commit: 4e45421f610eb881a03c0d82fca038788db12b08
2019-12-17 14:19:00 -08:00
Sean Sullivan 42da131431 Move patch functionality for apply into its own file.
Kubernetes-commit: 670369f2a4a7a7d9dad3a1ae1a334317a135f6c7
2019-12-16 16:41:49 -08:00
Sean Sullivan 65d873e277 Moved prune functionality into its own file.
Kubernetes-commit: e38e320222a1f44373ab3eaea8713f4772b26f6b
2019-12-16 16:13:39 -08:00
Sean Sullivan dfcc649b05 Refactored some apply printing functionality; removed unneeded count and objs variables
Kubernetes-commit: 07cb2fda5dada5c5145216bcab90e38426cf68e8
2019-12-16 15:21:57 -08:00
Sean Sullivan dd819b3425 Created GetObjects() method for ApplyOptions and integrated into apply
Kubernetes-commit: 02af4c9be20db201f2a2069816e97004a96bf760
2019-12-16 13:56:52 -08:00
Sean Sullivan 395bc6fc90 Changes Visit() to Infos() in apply to keep slice of objects
Kubernetes-commit: 2103ea4ddedc59d14322fd0fc34c8a9928256551
2019-12-16 13:00:33 -08:00
Anish Shah 3c43664ced Refactor `kubectl proxy` command to have similar design pattern as other kubectl commands.
Few days ago I watched this kubectl code base tour on Youtube
(https://www.youtube.com/watch?v=uz8TS3V9qqY). It talks about a design
pattern that almost every command follows. But I found out that
`kubectl proxy` command does not follow this pattern. So, I'm
refactoring this command to use similar design pattern as other kubectl
commands.

Kubernetes-commit: 0bd41a300f12b1dbaec19fc94b868f91640542df
2019-09-21 10:52:42 -07:00
Haosdent Huang 08def252f7 fix static check in kubectl/pkg/cmd/annotate.
Kubernetes-commit: 303c1a40bcee81fe14845d2af9dae2073f86ec52
2019-12-08 23:25:50 +08:00