Commit Graph

140 Commits

Author SHA1 Message Date
gavinfish 454ffd5141 Staticcheck: vendor/k8s.io/pkg/cmd/set|edit
Kubernetes-commit: 2b8e60bb21358608cfa46942e0b3210eee263ea8
2020-01-21 11:16:03 +08:00
Maru Newby 2cd642e11a kubectl: Update run's --restart help to reflect generator removal
PR #87077 ensured that only pods would created by `kubectl run`. This
change updates the help text for the `--restart` parameter to no longer
reference the removed job and deployment generators.

Kubernetes-commit: ab8b69b54eed552845c0548a30909f97ceaf0457
2020-04-02 21:30:25 -07:00
Maciej Szulik 6a446d6097 Re-use podAttachTimeout when waiting for pod readiness
Kubernetes-commit: c2bb76ebc902ea5172aa56db78d1fb59f4f88bec
2020-04-22 17:01:13 +02:00
knight42 b9bc004f47 fix(kubectl): explain crds with the same resource name with builtin objects
Kubernetes-commit: 397f107a0886999e0d45955dfe460112edd9ac5e
2020-03-26 16:07:06 +08:00
Maciej Szulik e6776b41f6 Fix kubectl version test to tolerate Run error coming from default
localhost:8080

Kubernetes-commit: 34865774a89db5f5b8684d5dd1042f6f4c2b21d0
2020-04-17 17:50:24 +02:00
Kazuki Suda 736b43aee9 Fix missing a shorthand for container flag of kubectl alpha debug
Kubernetes-commit: fca1027dd6d69ca7c5b3dd54059c29b2c8d04762
2020-03-31 12:15:17 +09:00
Riccardo Piccoli 9fae31af80 Change not found output when getting non namespaced resources
Signed-off-by: Riccardo Piccoli <riccardo.piccoli@gmail.com>

Kubernetes-commit: 818f011a2e7e1a05923f06c57ef6089e3a048fba
2020-02-13 17:28:06 +01:00
zhouya0 9d73fd8f3c Fix kubectl version should print version info
Kubernetes-commit: 948f4de2dbba3affca2de460d836158cbde5db78
2020-04-07 15:18:38 +08:00
Lee Verberne c401716d75 kubectl debug: support different kinds
This is a refactor ahead of adding support for supporting `kubectl debug` of nodes.

Kubernetes-commit: 8414d180feb9ddb0d4b9b80ea8e570dcacf98703
2020-04-03 14:31:18 +02:00
tipok b096826165 fix BusyBox sed
BusyBox sed works the same way as GNU sed

Kubernetes-commit: 6885919986250c33af63933d95b30d1896a8dd07
2020-02-28 11:06:30 +01:00
knight42 4e70f2b1a7 fix(kubectl): remove trailing space when completing file path
Kubernetes-commit: 2fefd9eea4db910eae2b3b86f4834d0892b659dc
2020-03-25 22:54:33 +08:00
Julian V. Modesto 489b062728 Support kubectl scale --dry-run=server|client
Kubernetes-commit: efed958779d564357a9965fccf43f64ee1feb972
2020-03-30 17:33:15 -04:00
Tatsuhiro Tsujikawa e7bb62301f Restore the ability to `kubectl apply --prune` without -n flag
Before https://github.com/kubernetes/kubernetes/pull/83084, `kubectl
apply --prune` can prune resources in all namespaces specified in
config files.  After that PR got merged, only a single namespace is
considered for pruning.  It is OK if namespace is explicitly specified
by --namespace option, but what the PR does is use the default
namespace (or from kubeconfig) if not overridden by command line flag.
That breaks the existing usage of `kubectl apply --prune` without
--namespace option.  If --namespace is not used, there is no error,
and no one notices this issue unless they actually check that pruning
happens.  This issue also prevents resources in multiple namespaces in
config file from being pruned.

kubectl 1.16 does not have this bug.  Let's see the difference between
kubectl 1.16 and kubectl 1.17.  Suppose the following config file:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: foo
  namespace: a
  labels:
    pl: foo
data:
  foo: bar
---
apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: bar
  namespace: a
  labels:
    pl: foo
data:
  foo: bar
```

Apply it with `kubectl apply -f file`.  Then comment out ConfigMap foo
in this file.  kubectl 1.16 prunes ConfigMap foo with the following
command:

$ kubectl-1.16 apply -f file -l pl=foo --prune
configmap/bar configured
configmap/foo pruned

But kubectl 1.17 does not prune ConfigMap foo with the same command:

$ kubectl-1.17 apply -f file -l pl=foo --prune
configmap/bar configured

With this patch, kubectl once again can prune the resource as before.

Kubernetes-commit: 7af3b01f24edfde34e42640ee565a5a6bb66ce26
2020-03-27 01:11:36 +00:00
Morten Hauberg 84b55fb518 Remove double `kubectl` from output
Kubernetes-commit: 5fe57c61482611361502544f36e9df3d17898449
2020-04-07 12:54:26 +02:00
Sean R. Sullivan 34abefcfa8 Even with build error, kubectl apply should apply all valid resources
Kubernetes-commit: 748ad74245778a93a68652cd7e804d6a1e13ad9d
2020-04-03 19:50:25 -07:00
Julian V. Modesto 1cfa7c66b3 Ensure diff doesn't persist patches
Kubernetes-commit: 9c0320f1bfd8edfb11c283b3fd422dc6e49360c5
2020-04-02 17:14:17 -04:00
Sean R. Sullivan 26ca5b3402 Fixes problem where kubectl apply stops after first error
Kubernetes-commit: b75990cc7bccc5693df34e29745eea0c98d095d1
2020-03-26 13:24:33 -07:00
Marek Siarkowicz 809652a24f Deprecate heapster related kubelet flags and remove their implementation
Heapster is retired since 1.11.
Having kubectl top mention Heapster is confusing for users.

Kubernetes-commit: 6d9fbd2d9f2fa77da20ebdf800d129e70ee7b932
2018-03-02 17:08:11 +01:00
Jordan Liggitt 53a6dfe9f1 Simplify dual or single port logic
Kubernetes-commit: dfeb617cc0e6a7b4c595eb5f7e927e9ceec1e18d
2020-03-23 22:04:14 -04:00
Marius Ziemke a45347152c fix kubectl port-forward for services with explicit local port
Kubernetes-commit: ef2eaa4f8f7ce85478310775a134047a77a8e310
2020-03-08 17:49:18 +01:00
Davanum Srinivas 196f0c117a Move k8s.io/apiserver/pkg/util/term to k8s.io/component-base/term
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 1d057da2f73118893b5cc27c15d59ff03beb271e
2020-03-16 16:27:44 -04:00
d-kuro 3cbb4ef3ee Fix ownerReferences.apiVersion for kubectl create job --from=cronjob
Kubernetes-commit: b78ab3515e85bb391e6cadc3374da7ac1992db1f
2020-02-28 14:28:27 +09:00
Brian Pursley 6464f40812 Removed unnecessary _complete call which was silently failing and causing zsh completion to return a nonzero exit code
Removed unnecessary _complete and _expand aliases for zsh completion

Kubernetes-commit: 04741b150effc1c963c1d1b6b2a8d9ce2019d375
2020-02-21 09:11:44 -05:00
Brian Pursley 1a80e2e210 Changed kubectl config view to redact token
Kubernetes-commit: 6fad4ee5e5f5fa6fbf38e88f165b012fa0ae5795
2020-03-17 15:13:50 -04:00
Julian V. Modesto 87fc988437 Set field manager for kubectl diff --server-side.
Bonus: check diff only dry-runs without persisting.

Co-authored-by: Takahiro HATORI <tahatori@zlab.co.jp>

Kubernetes-commit: bacc2c49605f608d3f919109e0c37ebf6e1d7036
2020-03-02 14:06:50 -05:00
Jordan Liggitt cfef71236e client-go: update expansions callers
Kubernetes-commit: d8abacba40a63395cc064452b09a244555536fca
2020-03-06 16:29:23 -05:00
Jordan Liggitt 0c62c9a83a client-go dynamic client: add context to callers
Kubernetes-commit: b7c2faf26c2a25427794478c6265e6d55e8acb5a
2020-03-06 10:17:41 -05:00
Jordan Liggitt 1de89515de client-go dynamic client: update DeleteOptions callers
Kubernetes-commit: b19dc3a474e840340cb357f5ea9f4e575bad888d
2020-03-06 10:20:40 -05:00
Lee Verberne c3d84a9e1c Add kubectl debug alpha command
This first version of `kubectl alpha debug` is an import of the existing
kubectl-debug plugin, which supports adding ephemeral containers to
running pods. This attempts to follow patterns used by other kubectl
commands such as run, exec and scale.

Kubernetes-commit: e5b655938e55e0404545ff73e9239593a27a3272
2020-01-31 15:29:31 +01:00
Brian Pursley 4f87593204 Changed kubectl cluster-info dump to not display "Cluster info dumped to standard output" message when output is stdout
Kubernetes-commit: 6de140567b37f6f41404237860a1c17e45e45296
2020-03-03 09:18:16 -05:00
Maciej Szulik ed686e3fbe Wire --filename flag to exec
Kubernetes-commit: 9dac1699bfdb0ff2b8bcfd76c42815b033b3cce0
2020-02-24 14:35:37 +01:00
David Eads 257e232d28 update override behavior for kubectl --tls-server-name
Kubernetes-commit: 9dcbc0bf909a794cf77a801bfd29e306791b1e24
2020-03-03 13:16:50 -05:00
Suresh Kumar Ponnusamy 55c8634c3c Support TLS Server Name overrides in kubeconfig file
Signed-off-by: Suresh Kumar Ponnusamy <suresh.ponnusamy@freshworks.com>

Kubernetes-commit: 37c81ed79ac6836bce4b96f888aa407dc18d747c
2019-08-28 10:51:14 +05:30
Maciej Szulik e034e09126 Squash pkg/describe/versioned/ into pkg/describe/
Kubernetes-commit: 02cd65d7bb5e4aea84a4f466186bcbbe604c4b27
2020-03-03 13:06:26 +01:00
Maciej Szulik e576e735d4 Deprecate --generator flag from kubectl create commands
Kubernetes-commit: be6ac856f13b994251b3c8e54b2251cf75c6847d
2020-02-28 11:58:53 +01:00
drfish 5aa1be61e1 Staticcheck: vendor/k8s.io/kubectl/pkg/cmd/exec|config|certificates
Kubernetes-commit: a14ceeb2c00d8048ce05ad199c919bdab6fb6954
2020-01-23 14:03:11 +08:00
Julian V. Modesto 5db847388b Hide deprecated --server-dry-run for kubectl apply
Kubernetes-commit: 7b214c96b01bf34345d4d7d82fcf5a85fd8318dd
2020-02-28 16:19:51 -05:00
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