Commit Graph

1105 Commits

Author SHA1 Message Date
Paco Xu 266e17f8a6 remove deprecated kubectl.kubernetes.io/default-logs-container support
Kubernetes-commit: 3a9c6f2a2f59cb05fc505f66afe2bd923a0d9f58
2022-04-02 16:40:34 +08:00
Mayank Kumar 884f866fd0 add maxunavailable to kubectl describe
Kubernetes-commit: c352fa514655bd154e69734e365477e753fa3409
2022-04-01 20:25:36 -07:00
Shubham Kuchhal e767a9773e Update rs.extensions to rs.apps
Kubernetes-commit: ce17a027477efd933775e320b1ce6c3876c136c3
2022-03-29 16:40:28 +05:30
Shubham Kuchhal bb7ded5a2e typo fix.
Kubernetes-commit: d350eb75d62bc51290826b94aa1d89bb6137595b
2022-03-30 18:57:43 +05:30
Shubham Kuchhal 32aa8d698a Updated the user and group flag.
Kubernetes-commit: bf77c2c3e7cdd67079742996cf47bac1003ffc26
2022-03-30 13:03:05 +05:30
Shubham Kuchhal 357211463f Improvement: Updated the serviceaccount flag for multiple subjects.
Kubernetes-commit: 3aa53c99a99f4dfe7d2e0faf2bf51e8252359e8d
2022-03-11 11:40:30 +05:30
Alexandre Garnier 459942a56d Do not raise an error proposing to use '--overwrite' when labeling with the same value (#105936)
* Do not propose to use '--overwrite' when labeling with the same value

* Check expected error value in label_test.TestLabelFunc

Kubernetes-commit: 10eb7092f854c71122c03752465e868bce23c0b6
2022-05-04 02:17:49 +02:00
Chok Yip Lau 7254bd442d Added --sum flag to kubectl top pod
Kubernetes-commit: 71acf56766c966653c3d1fe0ef6f3f036277d546
2021-09-16 09:28:30 -04:00
Maciej Szulik 5190a503cb Do not wrap lines if we can't read term size
Kubernetes-commit: a1c90674b5490d06ab4baccedc897e598882c457
2022-04-29 14:01:14 +02:00
James Laverack 03614470e1 Revert "Introduce APIs to support multiple ClusterCIDRs (#108290)"
This reverts commit b9792a9daef4d978c5c30b6d10cbcdfa77a9b6ac.

Kubernetes-commit: 7d57d5c70d04f652b431d2b86b8af40e119cd66a
2022-04-12 16:00:35 +01:00
Sarvesh Rangnekar f0ce177e80 Introduce APIs to support multiple ClusterCIDRs (#108290)
* Introduce networking/v1alpha1 api, ClusterCIDRConfig type

Introduce networking/v1alpha1 api group.

Add `ClusterCIDRConfig` type to networking/v1alpha1 api group, this type
will enable the NodeIPAM controller to support multiple ClusterCIDRs.

* Change ClusterCIDRConfig.NodeSelector type in api

* Fix review comments for API

* Update ClusterCIDRConfig API Spec

Introduce PerNodeHostBits field, remove PerNodeMaskSize

Kubernetes-commit: b9792a9daef4d978c5c30b6d10cbcdfa77a9b6ac
2022-03-31 06:17:21 +00:00
Katrina Verey 4424f53c23 Update kubectl kustomize to kyaml/v0.13.6, cmd/config/v0.10.6, api/v0.11.4, kustomize/v4.5.4
Kubernetes-commit: a8e1c67667288fb3aacc0a63a04b77aaac13bb4a
2022-03-28 19:22:08 -04:00
Chok Yip Lau de77e6a05b Remove generator dependency of expose.go
Kubernetes-commit: d7ab8d442b7913e5eb69fc2ce93b2b704645b089
2021-12-04 16:38:01 -05:00
Maciej Szulik 9ca2ff9172 Allow adding new verbs in AddSpecialVerb
Kubernetes-commit: 790396caba63f18ac529cf381b405390b62ad3e7
2022-03-28 12:49:02 +02: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
aimuz 062618c2be fix Kubectl describe node missing event
Kubectl describe node ignores the node events created by the controller
https://github.com/kubernetes/kubernetes/issues/106475

Kubernetes-commit: 8baac2ec951eba0669436d382752bfb3a38ff454
2021-11-17 16:24:26 +08:00
Daniel 12ebe4811f Fix: kubectl create -f and kubectl delete -f are not glob friendly (#102265)
* Fix: kubectl create -f and kubectl delete -f are not glob friendly

* gofmt fix

* removing unused receiver

* adding extra test

* log paths used

* fixing bad merge

* klog/v2 mod

* rebase fixes

* better error fmt

* error fmt unit test

* PR comments and tests

* Add reference to globbing to help snippets

Kubernetes-commit: 2cb3c7f706dbf266820fbde2e1b23a320e5d3de7
2022-03-28 05:45:26 +00:00
Rey Lejano b062628db1 updates for kubectl generated ref docs
Kubernetes-commit: 37a86e3e33349baa8fdfd25506dddb6009973337
2022-03-25 12:31:12 -07:00
Kevin Delgado 61f42e595f add server-side validation support to kubectl
Kubernetes-commit: fe3772890f650f9bcf020b43dc5a51fab0fa17f4
2022-03-09 14:52:32 +00:00
Arda Güçlü 11acf004c8 Remove deprecated discovery/ServerResources function
ServerResources function was deprecated and instead ServerGroupsAndResources
function is suggested.

This PR removes ServerResources function and move every place to use ServerGroupsAndResources.

Kubernetes-commit: ef39a8914291ba200bd5486c88a7575ffd4b7d1d
2021-12-22 11:14:09 +03:00
Ikko Ashimine be8cd595fc Fix typo in get_test.go
overide -> override

Kubernetes-commit: 10cdb0546aa7b89d8d6ab93d0826e4cda5c060eb
2021-12-13 22:56:22 +09:00
Maciej Szulik d2031a1eed Start deprecating long/golang version information
Kubernetes-commit: 43c09f6f9dc22771ac1b6b4459e4c2ce5d55c82a
2022-03-24 18:02:14 +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
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
Yuvaraj Kakaraparthi 38487e770c kubectl: add --support to get, patch, edit and replace commands
Co-authored-by: Nikhita Raghunath <nikitaraghunath@gmail.com>

Kubernetes-commit: a5aa858d44651ba48bdce634a39b55be91216614
2021-07-07 08:30:59 -07:00
Patrick Ohly 7c4cfc5d12 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.

Kubernetes-commit: edffc700a43e610f641907290a5152ca593bad79
2022-02-16 12:17:47 +01:00
Chok Yip Lau 6a5a78c26b Beautify kubectl help flag commands
Kubernetes-commit: 1c031d4fa8450550fa9a6bd5abe7fac45816156e
2021-09-02 13:41:07 -04:00
Katrina Verey 5bb84013cd kubectl version should include bundled kustomize version
Kubernetes-commit: 44e63e8ff8e7f98c75dc86d8c41553a5cce6a603
2022-03-23 19:17:29 -04:00
brianpursley 131a58c252 Renamed create_authinfo.go, create_cluster.go, and create_context.go
to match their kubectl config subcommand names and reflect that they
are used for setting values, not just creating.

Deprecated NewCmdConfigSetAuthInfo in favor of NewCmdConfigSetCredentials.

Did some minor refactoring of one of the complete functions to eliminate
an unused argument and not wrap returned errors that do not add detail.

Kubernetes-commit: 48007fc32bb473d1d0d7d7c24b9daa2157e433d1
2022-02-06 21:31:13 -05:00
mozillazg 66c4b40dd6 kubectl: Remove deprecated flags
Remove the deprecated `--serviceaccount`, `--hostport`, `--requests` and `--limits` flags

Kubernetes-commit: 95f5d507f5b5a19d9b031bfa5eb46e72311f9896
2022-03-19 15:32:06 +08:00
Alex Wang c66b6b69fa support preemptionPolicy in describe
Kubernetes-commit: 8ae182fff2ba0ce1543083b13a16ca37846de9da
2022-03-15 17:52:15 +08:00
Arda Güçlü 1474736be3 Remove DiscoveryClient from diff command
This PR removes `DiscoveryClient` field in diff command. Because
it is not used anywhere in diff command.

Kubernetes-commit: 5fdf97ad8e3a9b7a16479a5ec4ebff3d38c55a18
2022-03-08 09:59:49 +03:00
Monis Khan f315a5dd88 kubectl create token: use duration instead of expiration seconds
Expiration seconds is great for an unambiguous REST API.  It it not
a great input for a command line meant to be used by humans.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 6b9d556c9dc1fca37349833d38f8921f436e1874
2022-03-18 16:11:13 -04:00
jlsong01 7891f75f9e fix kubectl describe ingress shows default-backend:80 when no default backend
Kubernetes-commit: 75c139d567a193ec50aee5447546cacf4dfaf61d
2022-03-04 09:35:20 +08:00
kkkkun b5be321e1a sort custom column print flags
Kubernetes-commit: 36ed148761cb5a30c21b45a64d95cabd1a9d07ff
2022-03-03 22:31:58 +08:00
Jefftree ef358291b5 googleapis/gnostic -> google/gnostic
Kubernetes-commit: 8a1d5947ad34ba275192341baa4e5fef8e6c7f24
2022-03-15 20:36:21 -07:00
Kevin Delgado 7e681490ec Generalize dry run verify to arbitrary query param
Kubernetes-commit: d6c83281bc696474a76365a879f2255b8b568786
2022-03-09 14:51:50 +00:00
Lee Verberne 3d7e4b3f7f Print kubectl debug messages received when starting a container (#108591)
* kubectl debug: print container messages

This provides feedback to the user, for example that the server is
unable to pull the debug container image.

* Label debug container updates as warnings

Co-authored-by: Eddie Zaneski <eddiezane@gmail.com>

Co-authored-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 90956e6d3e9df02d932f9954911b89a3fd1619fb
2022-03-10 02:41:45 +00:00
brianpursley 5cd0db54d5 Add unit tests for cluster, context, and user command line completion functions
Kubernetes-commit: 996f79738e6f6c7dc9723cffe2b0bddc267777c6
2022-02-12 11:23:35 -05:00
W. Trevor King 5ff8356c5b kubectl drain: Generic "declare a controller" message
When it initially landed in kubernetes/kubernetes@c6e9ad066e (Initial
node drain implementation for #3885, 2015-08-30,
kubernetes/kubernetes#16698), the drain logic looked in a created-by
annotation for recognized kinds [1], so listing the set of recognized
kinds was a clear approach.

Sometime later, the source moved into ownerReferences, but the
hard-coded set of recognized controller kinds remained.

When kubernetes/kubernetes@2f1108451f (Remove hard-coded
pod-controller check, 2017-12-05, kubernetes/kubernetes#56864) removed
the hard-coded set of recognized controller kinds, it should have also
updated these messages to remove stale references to the previous
hard-coded values.  This commit catches the message strings up with
that commit.

[1]: c6e9ad066e (diff-211259b8a8ec42f105264c10897dad48029badb538684e60e43eaead68c3d219R216)

Kubernetes-commit: 587f4f04cc5fc18f4e85ed6a4a06bbf1bfee0496
2022-02-23 16:26:59 -08:00
jlsong01 4b64056435 kubectl version should fail when given extra arguments
Kubernetes-commit: 969cc463efcfacac728bac218534d0a027d448ee
2022-02-05 22:29:08 +08:00
czm 46b7c48533 fix defer in for loop, maybe resource leak
Kubernetes-commit: 684c5bf2a77f96b7db608e3c726a1d7da1a68421
2022-02-20 11:39:11 +08:00
Wojciech Tyczyński 3f11f31017 Stop setting selfLink in kubectl
Kubernetes-commit: 9015f27e6d8295d7dcdbf5915024f28cc00d4d2f
2022-02-16 17:13:54 +01:00
jlsong01 a64711ac83 add warning when kubectl set env from secret leads to uppercase
Kubernetes-commit: feb84ccef4a69fc1710003c71bc496b94448f094
2022-02-08 19:10:12 +08:00
Sebastian Sterk 31436b2c03 simple grammar fix
Kubernetes-commit: 5e286470fa16c4d53aa24b76a4fe94edf7b7016c
2022-02-02 00:02:11 +01:00
Eddie Zaneski 7eaddb97dd Update sig-cli OWNERS
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 040d575e9f464bf1e2982f4e105db6c127deb769
2022-02-14 10:51:52 -07:00
David Hotham 675d0d2328 Completions for kubectl config delete-user
Kubernetes-commit: 62eb74880cc3a97b04d1ea7fab62a207433a0f77
2021-12-20 14:40:56 +00:00
Eddie Zaneski d76986fd7a Change level for klog.Fatal
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: cd71d3f7881f0c66dbd28aec7af7a0ea0e2acf60
2022-02-10 14:43:19 -07:00
Marcus Puckett 3825e98528 Specify empty IngresClassName as <none> to more clearly specify it is empty
Kubernetes-commit: e7e2bfde16381dc9ae543123ebbe1da8c12ee8e4
2022-02-09 16:28:16 -08:00
Marcus Puckett cfc56a9d2c Update tests to account for new describe line for IngressClassName
Kubernetes-commit: 8b541910c0565781992065df779815519cffb362
2022-02-02 11:16:58 -08:00
Marcus Puckett 97f6de2e3a Add line to describe output for IngressClassName
Kubernetes-commit: cfacaf086a70a9513826cb4b5194412e61be477b
2022-02-02 11:16:39 -08:00
Marcus Puckett 23ee230608 Remove annoying sprintf warning
Kubernetes-commit: 517a0b0818e35a4b85fabd171f510da5b4e42549
2022-02-02 11:06:05 -08:00
Jordan Liggitt 344e97b543 Add command to request a bound service account token
Kubernetes-commit: fca9b1d9fcc7288ecb93c969ff9907a5def2dc9e
2022-01-31 11:46:50 -05:00
Jack 5fb22b2ab8 RunCordonOrUncordon error if drainer has nil Ctx or Client
Kubernetes-commit: ee02f5ddc42a67166c91e539fe98cc6541db668e
2021-09-27 14:20:24 -07:00
Bronson Mirafuentes 1d62bce235 wrap error from RunCordonOrUncordon
Kubernetes-commit: 297432f0e92479cfbb62d182d9d20c1833a3521c
2022-01-25 10:34:47 -08:00
Arda Güçlü 119abb31f8 Add manually invalidate cache documentation into delete
When CRDs are deleted, discovery local cache is not invalidated.
This brings about `resource not found` error when new CRD with same name is created
with different fields(ie. changing scope from cluster-wide to namespaced).
Because this already deleted CRD still stays in serverresources.json and kubectl tries to use it.

This local cached files have 10 minutes TTL. After deletion, if user waits 10 minutes,
files will be expired and deleted and there will be no errors. However, 10 minutes is a long time
and cache needs to be invalidated after deletion occurs.

This PR adds a document into delete command by noting that there might be a need to invalidate discovery
cache when CRD is deleted. In addition to that this PR adds a test to catch this behavior.

Kubernetes-commit: 43d8b3459baec794c8a3a858c04f1562a09886a3
2021-12-21 11:53:09 +03:00
Aram Peres 8e80d8fd7e Cleanup kubectl label selectors with 'cmdutil.AddLabelSelectorFlagVar'
Kubernetes-commit: 8f8138bc35f59ef04b77a3520d8d1065603ccdb7
2022-01-06 23:28:44 -05:00
ncapps 9f0231784c Update label selector message to clarify that constraints use AND operator
Kubernetes-commit: 62baa0af4c995cdf401339bfb92d6ae172fe5c6d
2022-01-07 17:25:17 +00:00
Sebastian Laskawiec cd508979c1 Fix printing control character in kubectl explain
Kubernetes-commit: e4dbaef3ccbd88d9e65befd8d0d666a793509ea2
2022-01-20 15:04:15 +01:00
astraw99 7f5c2f206a fix label msg
Kubernetes-commit: 83fe357f3e45423662f461f7cfd66bb18c122d33
2022-01-20 10:56:46 +08:00
brianpursley 24505ed13a Upgrade Cobra from 1.2.1 to 1.3.0 to fix a bug where bash completions don't work when the kubectl command uses the --context flag to specify a context that contains a colon
Kubernetes-commit: 64fac6cf49839ba058345dc471f038e5008a05f1
2022-01-12 10:37:13 -05:00
Davanum Srinivas 95fca74e1d OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9682b7248fb69733c2a0ee53618856e87b067f16
2022-01-03 10:59:47 -05:00
Philip Hamer b11bd1ffd7 add test case for issue 106277 (PR 106268) (#106532)
* add test case for issue 106277 - fix edit of non-registered custom API types

* remove unneeded struct, as suggested

Kubernetes-commit: ea2dff12e6df93ac27684707ea48f7781eb669b5
2022-01-12 01:49:19 +00:00
Kebe d100fd0cee Add completion for
Kubernetes-commit: a57e6c892448f0ef21d7af551170773b57e8b397
2021-11-30 18:20:05 +08:00
Tobias Klauser 7b07391a3a kubectl: remove unnecessary fmt.Sprintf
Directly use the %#v verb in fmt.Fprintf instead.

Kubernetes-commit: 169f1845fc29a9002645e0a4df9489fee1ae7128
2021-11-04 13:45:47 +01:00
Jian Li 3f7abd9859 cmd/kubectl: make 'kubectl logs' default to the first container when default container cannot be determined or found by annotations (#105964)
* cmd/kubectl: make 'kubectl logs' default to the first container.

While running 'kubectl logs <pod>', If '-c' is omited and the pod has more than one container, and no default container can be determined from annotations, this command shows an error message and exits. With this fix, it defaults to the first container in such scenarios and show its logs. This aligns behavior with what 'kubectl exec' does currently, and is more in line with KEP SIG-CLI 2227 design.

* fix unit test(forgotten)

* fix spelling typo

Kubernetes-commit: 0977a5d7cda59d5bd324bf2730846905e072fbbf
2022-01-07 09:40:41 +08:00
Aram Peres 22a27cb97d Add label selector in 'kubectl rollout' commands
Kubernetes-commit: 5a5ac86a80464019e3e85d57306156839511d397
2022-01-06 16:53:29 -05:00
W. Trevor King cdcb6ed356 kubectl: Document --for's Unicode case-folding condition-value comparison
When the wait command was added in 76794643c5 (add wait, 2018-05-18, #64034),
this comparison was via ToLower.  It moved to use Unicode case folding
[1,2] in f4940cf55f (Staticcheck:
vendor/k8s.io/kubectl/pkg/scale|describe/versioned|cmd/top|cmd/util/editor|cmd/top,
2020-01-21, #87403).

[1]: https://pkg.go.dev/strings#EqualFold
[2]: http://www.unicode.org/reports/tr30/tr30-1.html

Kubernetes-commit: f69d52338b21da938021af37f49f49a83016534d
2021-08-30 19:41:08 -07:00
Paul Barfuss 0208a3ee09 Replace hardcoded kubectl with kubectl.Name()
Kubernetes-commit: 77be26c3b83dd28be450c8790ecee823750f9a8c
2021-12-10 15:58:52 -05:00
Paul Barfuss 9b4102b899 kubectl: fix hard-coded value in zsh completion
Kubernetes-commit: 339c361ca0156cbf2be5aa64f52a0afd332f5708
2021-12-07 15:13:39 -05:00
Ricardo Katz 36401bb108 fix nil pointer in create secret commands
Kubernetes-commit: 50015c2da621ecaee581f64f737aa2e527905f14
2021-12-25 21:24:21 -03:00
Jonny Langefeld a8accff4dc Fix default config flags
This is a follow up to #105520 which only changed the new default config flags in the `NewKubectlCommand` function if `kubeConfigFlags == nil`. However they are not nil because they were initialized before here:
2fe968deb6/staging/src/k8s.io/kubectl/pkg/cmd/cmd.go (L97)

This fix uses the same defaults for both functions

Signed-off-by: Jonny Langefeld <jonny.langefeld@gmail.com>

Kubernetes-commit: c4fbd35cf4bdc76b86dd74e468b69328f5aa20f9
2021-12-19 19:59:46 -08:00
Ross Peoples 88ea823a7a Allow create.specialVerbs to be customized
Kubernetes-commit: 9b2f24aee0668ef54e7f51acc79e51b93f1aedb3
2021-12-16 13:08:28 -06:00
Arda Güçlü f6fcb7d932 Enable setting proxyurl in kubeconfig via kubectl config (#105566)
* Enable setting proxyurl in kubeconfig via kubectl config

This PR enables setting `proxy-url` in kubeconfig via kubectl config.

* Add godoc for proxy-url unit tests

Kubernetes-commit: afdde383210294c3da573decc44b5ce55cffcb94
2021-12-20 21:54:05 +00:00
Ross Peoples 866baec66e Allow custom img resolver and flags for set image
Kubernetes-commit: 2f56584853355c0ab16e5ad2b0195d8dfcd7dc6b
2021-12-16 14:06:46 -06:00
sunzhaochang 16d7d99cc5 Add Close() for profile
Kubernetes-commit: 82c9d80295451dad4b9a5af89f34bb56b3a9904b
2021-12-15 21:03:34 +08:00
Julian V. Modesto 5c9b92b57c Re-introduce removed kubectl --dry-run values.
For 1.23, we removed the kubectl `--dry-run` empty default value (`--dry-run`)
and boolean values (`--dry-run=true` and `--dry-run=false`). This change
required requiring users to specify `--dry-run=client` or `--dry-run=server`
due to a deprecation. This change was made in #105327.

After reconsideration, this change is not worth the churn for users.
It's likely that many users rely on these values for automated and manual use
cases.

This change reverts #105327 and re-introduces the values `--dry-run`,
`--dry-run=true`, and `--dry-run=false`.

Kubernetes-commit: cc4998b2b131ca9906b847600bd5ad3be70eff3a
2021-12-13 15:04:49 -05:00
Arda Güçlü ab3928acd9 Refactor diff/prune
This PR does some refactors for diff/prune;

- GetRESTMappings takes value array instead reference
- Move getObjectName into diff instead prune
- License, etc. changes

Kubernetes-commit: 6c449dd272c95f2aeb3bb77e67d312d8df21bd62
2021-11-08 11:22:10 +03:00
Arda Güçlü 2d0f4303f1 Get object name correctly for pruned resources
Kubernetes-commit: a19bd5e47436c1f0a2aea20c4a992da18f8ba480
2021-10-06 17:01:19 +03:00
Arda Güçlü 292510bc0b Add pruner constructor, tweak DiffOptions
Kubernetes-commit: 05100c0e49328cd149e96aa78fefc91c8c97ffee
2021-09-30 11:26:40 +03:00
Arda Güçlü eee66ad171 Add boilerplate header into util/prune
Kubernetes-commit: f4861725c9a8494481093d30a5f6e07f7ab8f2d7
2021-09-29 12:20:38 +03:00
Arda Güçlü 3f914a34f1 Add new unit tests for diff/prune
Kubernetes-commit: 17de414905fb3463ec17ec63f40180fa09965d98
2021-09-24 09:40:26 +03:00
Arda Güçlü ff5d018049 Introduce new prune parameter into diff command
This PR introduces new prune and it's dependent parameters to simulate
`kubectl apply --prune` command.

Kubernetes-commit: 56c19f1056ad6d4a4bb926fe90e37f56a31c4e2f
2021-09-17 15:27:21 +03:00
Davanum Srinivas 12c6b0404d Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
haoyun 343b5260f3 fix: combine assertion prevent npe
Signed-off-by: haoyun <yun.hao@daocloud.io>

Kubernetes-commit: 84a7329cf07b468ea47fd0617e6fdb9bdb174937
2021-12-01 16:37:24 +08:00
Andrea Hoffer d6145c119b Adding an example for kubectl plugin list
Kubernetes-commit: f5612f100ef6a61dcc29ca783571e2b3c171abf1
2021-11-22 13:21:21 -05:00
Sergey Kanzhelev 8f510212ee Merge pull request #106463 from SergeyKanzhelev/grpcProbe
Implement grpc probe action

Kubernetes-commit: e4952f32b79b69bfa9333ff9da26a2da13859148
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-02 20:40:51 -05:00
Antonio Ojea 6dd58defe1 remove inefficient assignment
Kubernetes-commit: e1821c13ebf78ac6e022948aa9415d9cc0b28a77
2021-11-16 19:00:51 +01:00
Antonio Ojea 476fa148b6 fix ineffectual assignment to i (ineffassign)
Kubernetes-commit: b2971e74970f241e138c93f5e755aa2980ab13ed
2021-11-16 18:08:27 +01:00
Maciej Szulik 691bf81946 Allow changing discovery QPS with cli-runtime
Kubernetes-commit: 2fe968deb6cef4feea5bd0eb435e71844e397eed
2021-11-16 22:27:33 +01:00
Maciej Szulik ca7662ebb5 Bump discovery burst for kubectl
Kubernetes-commit: e944d2c365af0d2d2784dd8f71f90ca5bd0cdbc9
2021-11-16 22:26:32 +01:00
Daniel Lipovetsky 8e82388f5f Include Conditions in `kubectl describe namespace`
If a namespace deletion is blocked, finding the reason why can require
reading the Conditions on the namespace.

Currently, `kubectl describe namespace` does not include Conditions.
This change adds Conditions to the output. Example output:

```
Name:         example
Labels:       <none>
Annotations:  <none>
Status:	      Terminating
Conditions:
  Type                             Status  LastTransitionTime               Reason          Message
  ----                             ------  ------------------               ------          -------
  NamespaceDeletionContentFailure  True    Wed, 15 Jan 2014 00:00:00 +0000  example reason  example message

No resource quota.

No LimitRange resource.
```

Kubernetes-commit: eb6e8ce00a39c1c98146f3341f4336b90757ab13
2021-11-07 21:39:56 -08:00
yuzhiquan b2f4fe7648 move remainingNodes outof drain loop
Kubernetes-commit: 0c66b43d7a7d82a5ff7e330aeecd2aa7f3c092e1
2021-10-12 09:26:22 +08:00
yuzhiquan c74a1185c3 remove ignore error flag for drain, and set this feature as default
Kubernetes-commit: f54d2a0dd1dd5c143fb32dae5c627dba87d6df7e
2021-10-08 19:44:26 +08:00
Patrick Ohly dc8558e8e5 kubectl: add deprecation notice to flag usage help
Several klog flags were deprecated in Kubernetes 1.23, but that was not visible
in "kubectl options" because it does its own formatting without considering a
flag's deprecation string.

Now the output looks like this:

$ go run ./cmd/kubectl options
The following options can be passed to any command:

      --add-dir-header=false: If true, adds the file directory to the header of the log messages (DEPRECATED: will be
removed in a future release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --alsologtostderr=false: log to standard error as well as files (DEPRECATED: will be removed in a future release,
see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --as='': Username to impersonate for the operation. User could be a regular user or a service account in a
namespace.
      --as-group=[]: Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --cache-dir='/home/pohly/.kube/cache': Default cache directory
      --certificate-authority='': Path to a cert file for the certificate authority
      --client-certificate='': Path to a client certificate file for TLS
      --client-key='': Path to a client key file for TLS
      --cluster='': The name of the kubeconfig cluster to use
      --context='': The name of the kubeconfig context to use
      --insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will
make your HTTPS connections insecure
      --kubeconfig='': Path to the kubeconfig file to use for CLI requests.
      --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace (DEPRECATED: will be removed in a future
release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-dir='': If non-empty, write log files in this directory (DEPRECATED: will be removed in a future release,
see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file='': If non-empty, use this log file (DEPRECATED: will be removed in a future release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file-max-size=1800: Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0,
the maximum file size is unlimited. (DEPRECATED: will be removed in a future release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-flush-frequency=5s: Maximum number of seconds between log flushes
      --logtostderr=true: log to standard error instead of files (DEPRECATED: will be removed in a future release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --match-server-version=false: Require server version to match client version
  -n, --namespace='': If present, the namespace scope for this CLI request
      --one-output=false: If true, only write logs to their native severity level (vs also writing to each lower
severity level) (DEPRECATED: will be removed in a future release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --password='': Password for basic authentication to the API server
      --profile='none': Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)
      --profile-output='profile.pprof': Name of the file to write the profile to
      --request-timeout='0': The length of time to wait before giving up on a single server request. Non-zero values
should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
  -s, --server='': The address and port of the Kubernetes API server
      --skip-headers=false: If true, avoid header prefixes in the log messages (DEPRECATED: will be removed in a future
release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --skip-log-headers=false: If true, avoid headers when opening log files (DEPRECATED: will be removed in a future
release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --stderrthreshold=2: logs at or above this threshold go to stderr (DEPRECATED: will be removed in a future
release, see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --tls-server-name='': Server name to use for server certificate validation. If it is not provided, the hostname
used to contact the server is used
      --token='': Bearer token for authentication to the API server
      --user='': The name of the kubeconfig user to use
      --username='': Username for basic authentication to the API server
  -v, --v=0: number for the log level verbosity
      --vmodule=: comma-separated list of pattern=N settings for file-filtered logging
      --warnings-as-errors=false: Treat warnings received from the server as errors and exit with a non-zero exit code

For comparison, pflag itself prints:

$ go run ./cmd/kubelet --help 2>&1 | grep -e --log-file
      --log-file string                                          If non-empty, use this log file (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
      --log-file-max-size uint                                   Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)

Kubernetes-commit: 21bd4ae18b5a146c8ef6dff373732abdecf60d66
2021-11-05 09:34:25 +01:00
Philip Hamer 7da3d10e34 fix edit of non-registered custom API types
Kubernetes-commit: e07a6c9e523c11509f3264ad1ef2ea381709a29c
2021-11-09 10:06:03 -05:00
Chok Yip Lau 8d1dfaeedb Added JSONPath wait for kubectl wait
Co-authored-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 8fcf98ec3bb16ddf32ea1688752e6b7e2a14eaa4
2021-10-04 16:19:08 -04:00
Maciej Szulik 19d74f894c Switch from arguments to an input structure for kubectl command
Kubernetes-commit: baab99d04cd4c4314525e19c14ec85a072161cb1
2021-11-04 16:29:08 +01:00
Maciej Szulik d89f23e807 Allow providing wrapper for client config
Kubernetes-commit: c5aea015c30735b0e64f8bbd41acd811782c1fe5
2021-11-04 16:14:27 +01:00
Matthias Bertschy 68250fd482 add option to make kubectl cp resume on errors
Kubernetes-commit: 00b528cdf42ae4c1771f3a51c557a1f289701113
2021-09-06 10:04:15 +02:00
Chok Yip Lau aed179d9d5 Fixed nil pointer dereference
Kubernetes-commit: c337857673e60a44bbdbef9afcbce5b0245b81ec
2021-11-10 12:41:39 -05:00
yylt 0198d9185e Fix edit command
Kubernetes-commit: 2ae37c8046128e0191ec96c8b31361ae894f2330
2021-10-21 20:07:38 +08:00
Sai Harsha Kottapalli 8165f83007 Refactor Apply cmd to split flags from options (#102240)
* Refactor Apply cmd to split flags from options

* refactor code

* fix subcommands

Kubernetes-commit: 17919b184153b2d123a7c75f5b0dc7e486a724db
2021-11-08 17:17:08 +00:00
Daein Park 5acf82be0d Add a flag to enable "Capacity" instead of "Allocatable" for an actual node memory total usage.
If "Allocatable" is used to a node total memory size, under high memory pressure or pre-reserved memory value is bigger, the "MEMORY%" can be bigger than 100%.
For suppressing the confusing, add a option to show node real memory usage based on "Capacity".
* Reference: https://github.com/kubernetes/kubernetes/issues/86499

Kubernetes-commit: 862937bf1c7975d3f54ae47a2958e47f2c50150f
2021-06-16 21:25:52 +09: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
Shin'ya UEOKA 791e7f9d0b test: Assert max unavailable for PDB test cases
Kubernetes-commit: 5c76507c3f9dd84dd3a56b39a45f99da1735bfed
2021-10-28 05:20:03 +00:00
astraw99 2ad6554e1e fix kubectl unlabel msg
Kubernetes-commit: cec30fdbedc326ef0abcbd8475b89840ae0f776d
2021-08-15 14:56:07 +08:00
卢振兴10069964 165827de9c code cleanup for kubectl
Kubernetes-commit: 17993020cdca7eea2fb96a993e048d2d0624fa40
2021-04-12 10:45:08 +08:00
Paco Xu 4cb63581c6 cleanup: add update notice in origin file & make it diff cleanly
Kubernetes-commit: b74214ebcb2acbd3b188bda6f856d9a851b1ea96
2021-09-15 13:43:00 +08:00
thomassong 6847974534 fix: include init containers when determining pod QoS that keep consistent with kubelet
Signed-off-by: thomassong <thomassong2012@gmail.com>
Co-authored-by: Paco Xu <paco.xu@daocloud.io>

Kubernetes-commit: 285e43d208a29acc9d19c47099699fe13d012f8a
2021-02-05 09:30:00 +08:00
Bryan Boreham 0a152f103a 'kubectl events' command (#99557)
* Basic scaffolding for kubectl events command

* Simple implementation of 'kubectl events'

* Print event fields

Borrowing code from 'kubectl describe'

* Sort events before printing

* Make output more like 'kubectl get events'

Print namespace if fetching from all

* Refactor: extract print functions

To make it easier to add watch function next.

* Implement watch for new events

Run the list function same as before, so those events come out in order,
then watch from the ResourceVersion after the last event.

* Clear up some lint warnings

* Update description and example text

* refactor: introduce a listOptions variable

* Implement --for option

splitResourceTypeName() function borrowed from cli-runtime because we
need similar behaviour to Builder.ResourceNames(), but applying to
Event.InvolvedObject.

* Add kubectl/pkg/cmd/events to vendor/modules.txt

* Add back cmdutil.Factory

Needed in NewCmdAlpha to construct the 'events' command

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Fix lint

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Make package alias go-cromulent

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use genericclioptions.RESTClientGetter instead of cmdutil.Factory

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Decode object parameter to GroupVersionKind and name

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Merge two files into one

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Include example for --for option

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Fix inconsistent option name in error message

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Remove unnecessary Validate call

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use fields from event series

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Support chunking of list of events

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use watchtools utility to receive watch events

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Split struct into flags and options

Flags represents the inputs from the CLI; options are what the running
command needs. This structure parallels the 'wait' command, and should
be easier to write tests for.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Add some parameters to usage string

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Do only one of list or watch

We tried to print the list first then start a watch after the last
event, but sometimes the server will return "watch is too old" on that
ResourceVersion.
Instead, if we need to watch just start it from the beginning.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Print message if no events found

Also, if watching, don't print the headings until the first event
arrives.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

Kubernetes-commit: a988182f595af64bc007ba9162509e089c36fd89
2021-10-29 17:13:38 +00:00
Aldo Culquicondor def56a58a5 Add ready field to Job status
to keep a count of the pods that have the ready condition.

Also:
- Add feature gate JobReadyPods.
- Add Ready to describe.

Change-Id: Ib934730a430a8e2a2f485671e345fe2330006939

Kubernetes-commit: 1bff5eb44d9897e12aff3ea10f5a856580158278
2021-09-08 14:31:59 -04:00
Ross Peoples dc5f5d4011 drain node output should say drained not evicted
Kubernetes-commit: 0cf3dba1f1df9555a46f2a086e48dcfe3c9ad6b2
2021-10-18 11:05:28 -05:00
Marc Khouzam b111bee570 Complete multiple resource names
This commit teaches the completion function to repeat resource names
when supported by the command. The logic checks if a resource name
has already been specified by the user and does not include it again
when repeating the completion.

For example, the get command can receive multiple pods names, therefore
with this commit we have:
  kubectl get pod pod1 [tab]
will provide completion of pod names again, but not show 'pod1' since
it is already part of the command-line.

The improvement affects the following commands:
- annotate
- apply edit-last-applied
- apply view-last-applied
- autoscale
- delete
- describe
- edit
- expose
- get
- label
- patch
- rollout history
- rollout pause
- rollout restart
- rollout resume
- rollout undo
- scale
- taint

Note that "rollout status" only accepts a single resource name, unlike
the other "rollout ..." commands; this required the creation of a
special completion function that did not repeat just for that case.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 7aa5cb40316dbeb970250ee0835fbd597fd19a20
2021-10-15 15:36:09 -04:00
Marc Khouzam b9e380aef5 Add completion to the --output/-o flag
For example:
$ kubectl get -o json<TAB>
json   jsonpath   jsonpath-as-json  jsonpath-file

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: 5f22baeaf1f662d0fe90ea41e453883cb726323c
2021-10-22 15:15:23 -04:00
zc 7f3d19c990 add unit tests for updateEnv
Kubernetes-commit: f79183f2918446907da08325066a334466146711
2021-09-08 10:49:15 +08:00
Jérôme Petazzoni eadcbb187a Minor improvements in 'kubectl run' flag help
I initially noticed a minor typo in --tty, and while fixing it,
I noticed small discrepancies in some other flags. These minor
changes should make the 'kubectl run' flag help slightly more
correct (hopefully). 🙂

Kubernetes-commit: 7ca336caf383bca9848cab64657a92b025f34312
2021-10-06 16:57:47 +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
Arda Güçlü 8307ca4a3c Add diff command return status code greater than 1 when flags invalid
This PR adds flagerror handler function to detect when flags are invalid.
Default flag handler returns status code 1. However, diff command embraces
this status code as changes are found. By overriding flag errors,
this PR shows same message with default case and returns status code 2.

Kubernetes-commit: 4f0848520d4cdd679c76479949546002c5935e3c
2021-10-04 13:02:34 +03:00
Marc Khouzam e6118325f3 Ignore flags that could precede the Cobra command
See https://github.com/kubernetes/kubectl/issues/1119

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: d41c2685b67317fea1d1a3843d8f5870bc724b3b
2021-09-20 18:20:49 -04:00
Marc Khouzam 10504c18ad Do not try to load plugins for cobra commands
Cobra adds the commands 'help', '__complete' and '__completeNoDesc'
inside rootCmd.Execute(), however, when kubectl decides if it should
lookup plugins, rootCmd.Execute() had not been called yet.  Therefore,
the call to cmd.Find(cmdPathPieces) done by kubectl does not find the
commands added by Cobra.  To fix this we must check for them explicitly.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Kubernetes-commit: e703b3d25377e763b117805b3d88fe7236f3ff76
2021-09-19 14:34:10 -04:00
Sean Sullivan 8a45e525e5 Fixes kubectl command headers which hangs on kubectl run
Kubernetes-commit: 1d1a5499e717b928c6b2782fdcad9fa4052a38a1
2021-09-30 13:53:00 -07:00
Patrick Ohly 466b483531 initialize logging after flag parsing
It wasn't documented that InitLogs already uses the log flush frequency, so
some commands have called it before parsing (for example, kubectl in the
original code for logs.go). The flag never had an effect in such commands.

Fixing this turned into a major refactoring of how commands set up flags and
run their Cobra command:

- component-base/logs: implicitely registering flags during package init is an
  anti-pattern that makes it impossible to use the package in commands which
  want full control over their command line. Logging flags must be added
  explicitly now, something that the new cli.Run does automatically.

- component-base/logs: AddFlags would have crashed in kubectl-convert if it
  had been called because it relied on the global pflag.CommandLine. This
  has been fixed and kubectl-convert now has the same --log-flush-frequency
  flag as other commands.

- component-base/logs/testinit: an exception are tests where flag.CommandLine has
  to be used. This new package can be imported to add flags to that
  once per test program.

- Normalization of the klog command line flags was inconsistent. Some commands
  unintentionally didn't normalize to the recommended format with hyphens. This
  gets fixed for sample programs, but not for production programs because
  it would be a breaking change.

This refactoring has the following user-visible effects:

- The validation error for `go run ./cmd/kube-apiserver --logging-format=json
  --add-dir-header` now references `add-dir-header` instead of `add_dir_header`.

- `staging/src/k8s.io/cloud-provider/sample` uses flags with hyphen instead of
  underscore.

- `--log-flush-frequency` is not listed anymore in the --logging-format flag's
  `non-default formats don't honor these flags` usage text because it will also
  work for non-default formats once it is needed.

- `cmd/kubelet`: the description of `--logging-format` uses hyphens instead of
  underscores for the flags, which now matches what the command is using.

- `staging/src/k8s.io/component-base/logs/example/cmd`: added logging flags.

- `apiextensions-apiserver` no longer prints a useless stack trace for `main`
  when command line parsing raises an error.

Kubernetes-commit: 21d1bcd6b8498370832fa76f680d3de56837bc83
2021-09-16 18:18:35 +02:00
wujiangfa-xlauncher cadea4d691 fix top node output format incorrect
#105112

Kubernetes-commit: e838017f11dae4bc1c0a12c9703d0153661bd27d
2021-09-18 09:41:51 +08:00
caozhiyuan 0cf1a18bec handle error when parse Quantity
Kubernetes-commit: b9d7584c3a838d83c6c8c6e405907bf05addc850
2021-09-18 15:05:21 +08:00
Julian V. Modesto f9ab824bc9 Remove deprecated kubectl --dry-run values.
The boolean values for --dry-run have been deprecated for removal since
1.18, more than 2 releases.

The default value for --dry-run with the flag set and unspecified has
been deprecated for removal since 1.18, more than 2 releases.

Both values are now removed in this change. Any kubectl --dry-run
usage no longer accepts --dry-run=(true|false) boolean values and usage
now requires that a value of (client|server|none) is specified.

Kubernetes-commit: e0b7a85ee5b5d546bec2dc0e8cbf5cd4c0c684d8
2021-09-28 10:03:20 -04:00
Chok Yip Lau fad6761bba Improve configmap test
Kubernetes-commit: fa7ad6e4657769f767e3a34407cb6ad327d5259c
2021-09-03 15:54:11 -04:00
Harjas 809211b6c8 kubectl: Use fields from event series when computing describe events for a object (#104482)
* take into account new fields for event

* add event with old event fields for test

* fix: remove unnecessary "+1" from event series count

* fix: update the assertion for failing test case

Kubernetes-commit: c6935ad50e0809c1dc2d3ac9000abda0ecb49bcc
2021-09-14 00:18:50 +00:00
Eddie Zaneski 20604e9e21 Remove functionality from deprecated kubectl run flags
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: da8f404ae09823ff5fa214397215263f095e90f2
2021-09-09 15:22:28 -06:00
jaehnri 72b220068c Fix typo in kubectl describe pods example
Signed-off-by: jaehnri <joao.henri.cr@gmail.com>

Kubernetes-commit: bf1b75f165d0afde7fe9bc810425b488b5c1659e
2021-08-26 21:00:18 -03:00
Zovin Khanmohammed 723266d145 Adds the PowerShell completion generation (#103758)
* Adds the powershell completion generation

* Fixes formatting based on verification script

* Changes generation to include descriptions

* Adjusts formatting and Adds startup information

* Fix build

Kubernetes-commit: dec8528abaa58a4c7fc190df2cad8848799f9891
2021-08-25 22:29:23 -05:00
Wei Lun cdae2c3d88 fix indentation
Kubernetes-commit: 8a1987f0da1d6d881272f9609cadc03fa32c6f11
2021-08-10 16:31:32 +08:00
Wei Lun cb657f63a2 add kubectl fish shell completion
Kubernetes-commit: 3f5176c26512fdb9154a0bd1d34ee61196874251
2020-07-11 22:07:05 +08:00
Stephen Augustus 55e15b6165 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Chok Yip Lau 5d2f1d8a56 Added support for multiple --from-env flags
Kubernetes-commit: 9a13bae5108beb113dd0ca5605f4adeeac127915
2021-08-09 00:05:43 -04:00
fabiankramm 3d34311c79 kubectl proxy: append context host path to request path
Signed-off-by: fabiankramm <fab.kramm@googlemail.com>

Kubernetes-commit: b1a6f8cdf90c0a3861157fea24dcfa89c2aafcf9
2020-12-16 17:37:44 +01:00
Senthil Kumaran 5f6099143c Provide reference to impersonation options for kubectl auth can-i command.
Kubernetes-commit: ef181c14e128fd70c9d95193d676e1019601556c
2021-07-19 21:08:04 -07:00
Di Xu f106a734e3 cleanup description on deprecated include-uninitialized flag
Kubernetes-commit: ae7b9787ee7b46bb83b05d3769ed54374c0337a7
2021-07-26 11:14:55 +08:00
Eddie Zaneski 3e89fad72d Fix kubectl version unit test
Signed-off-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 93ef5acb35f40e6cb5aae3297858371349fed10a
2021-07-27 11:46:45 -06:00
huiwq1990 de9043d5d2 use already defined variable
Kubernetes-commit: 7aab5df381fb58814afdc0bba1b7352332d53edb
2021-03-13 15:49:44 +08:00
kabab 3e3ae2747f kubectl: Add labels to ingress describe
Kubernetes-commit: 2ad2bc6844318034dd3296a0b0d5a7ce97e51962
2021-07-24 22:56:36 +02:00
Manu Gupta 2e61cacc45 fix: 81134: display conflicted taint without a json representation.
1. string is formatted as unsafe json. Since this is created on the fly;
TaintKey and Effect are formatted as a 'key=effect' instead of '{key=effect}'
eliminating unsafe json representation.

2. Adds a fail test case for the case where a taint with same key and effect is added
and removed together.

Manual Testing

```
▶ ./_output/bin/kubectl taint nodes kind-control-plane key1=:NoSchedule key1=:NoSchedule-
error: can not both modify and remove the following taint(s) in the same command: key1=NoSchedule
```

Kubernetes-commit: 1a3eda9394b7ff473434506f2756cc9df6288cea
2021-07-29 23:26:07 +00:00
novahe 95ce5a060b remove stack trace log when sorting with a bad unsortable field
Kubernetes-commit: abf735daa83f1d931614292664c2df1c6735aebb
2021-07-03 21:34:41 +08:00
Chok Yip Lau 95dc04b3b3 Added support for multiple --from-env flags
Kubernetes-commit: 99bc2b077fd208885e76281ab8865f1e85f0abb8
2021-04-29 19:16:59 -04:00
Zhou Peng 7454a6489e [k8s.io/kubectl/pkg/drain/drain]: minor typo fixup
Signed-off-by: Zhou Peng <p@ctriple.cn>

Kubernetes-commit: 7e2d6301bf95893ea74116871d2c2f6392217105
2021-08-01 07:07:31 +08:00
Kebe 316e6d8845 Fix the code is leaking the defaulting between unrelated pod instances
Kubernetes-commit: 412962204ffdfcbe6407e66125b1b499d86d49ed
2021-07-09 09:57:05 +08:00
atiratree 1c26c91ee7 kubectl: show consistent unit format in quota describe
API returns unit format in a non deterministic manner; ie it
chooses a unit format according to a resource that gets counted first

Kubernetes-commit: 3f0b64ec9597488be6365f89cc82338bcb7a9feb
2021-05-20 15:36:04 +02:00
navist2020 2128ec58c8 remove Factory that not used
Kubernetes-commit: 0a83041d4d3698d36ade2a310184248c61eec64f
2021-05-17 16:56:12 +08:00
nobuhikosawai 1e8e38ace7 kubectl: update set command description to include cronjob resource (#102503)
* kubectl: update set command description to include cronjob resource

* kubectl: update set command description to include statefulset resource

* kubectl: update set env description to remove job from resources that can update container env

* kubectl set tests: add cronjob resource and remove job resource

* go fmt

Kubernetes-commit: 41c5bca3496b516ddf52618deb44a421b89a49f1
2021-07-09 00:50:54 +09:00
atiratree 9a63531dee update translations
Kubernetes-commit: 33e6ebc8f8df47864a77c867d78216adb70cd79d
2021-07-06 20:43:49 +02:00