Commit graph

908 commits

Author SHA1 Message Date
Yashasvi Misra
87e157cce8 top command documentation enhancement (#136825)
* top command documentation enhancement

* Added FAQ details

Kubernetes-commit: 1132a4e4efd80d50b9ef17e1ec479c2d73979f25
2026-03-19 20:03:52 +00:00
Davanum Srinivas
30e6509a72 staging: extract CRI streaming modules with client-go compatibility
Extract streaming code into dedicated staging modules while keeping stable
compatibility APIs for external client-go consumers.

This commit:
- adds `k8s.io/cri-streaming` for CRI exec/attach/portforward server code
- adds `k8s.io/streaming` as the canonical home for shared transport
  primitives (`httpstream`, `spdy`, `wsstream`, runtime helpers)
- switches in-tree transport consumers to `k8s.io/streaming`
- removes in-tree kubelet CRI streaming package
- preserves NO_PROXY/no_proxy CIDR handling in extracted SPDY proxier logic
- adds deprecated `k8s.io/apimachinery/pkg/util/httpstream` compatibility
  wrappers (`httpstream`, `spdy`, `wsstream`) backed by `k8s.io/streaming`
- restores exported client-go SPDY/portforward API signatures to
  apimachinery `httpstream` types for downstream compatibility
- adds streaming-native client-go adapters/constructors so in-tree callers
  can use `k8s.io/streaming` without changing external compatibility APIs
- deduplicates SPDY-over-websocket dial negotiation shared by compat and
  streaming tunneling dialers
- logs dropped unknown stream types in `RemoveStreams` adapter fallbacks to
  improve compatibility-path debuggability
- adds integration coverage for the streaming-upgrader-to-client-go-compat
  adapter path against a real cri-streaming exec endpoint
- clarifies kubectl streaming import aliasing to avoid `httpstream` package
  ambiguity
- updates tests, import restrictions, publishing metadata, and vendor/module
  metadata for the new staging modules

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 1ee1ff97fb7f9755a44d29bee0c80d2ccbed68dc
2026-02-28 19:40:07 -05:00
Brian Pursley
b7be88fba8 Check wait condition type cast to avoid potential panic
Kubernetes-commit: 37257404a56bfe609b43d9969933a2d9d478a5d7
2026-03-05 18:41:52 -05:00
Peter Engelbert
cce0d1aef0 Add credential pluginkubectl kuberc set options (#137300)
* Add <...> kuberc set --section=credentialplugin

The requirement that the `--command` option be provided is no longer
valid; a solution will need to be found.

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Remove required mark on `--command` flag

Move the validation logic to the Validate() function

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Remove requirement for `--command`

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Add cmd test cases for kuberc

- Verify all error messages added/changed by this PR
- Verify changes are effected by at least one valid `kubectl kuberc
  set` invocation with --section=credentialplugin

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Add unit tests for --section=credentialplugin

Additionally:
- Update allowlist-entry validation logic to check for empty string in
  value of k/v pairs
- Update kuberc cmd test with this case as well

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Address linter complaints

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Update staging/src/k8s.io/kubectl/pkg/cmd/kuberc/set.go

Co-authored-by: Maciej Szulik <soltysh@gmail.com>

* Add two new test cases

Additionally:
- update error message when policy is invalid
- use utilerrors.NewAggregate instead of custom code
- add --section=credentialplugin example to cli help
- fix copypasted doc comments
- use more descriptive variable names in for loops
- avoid confusion due to variable shadowing
- fix capitalization typo
- check both validate and run errors in credentialplugin tests

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

* Improve cli help for policy flag

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

---------

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Co-authored-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: b4220f8b08949c115258abed0398512bf54ffc48
2026-03-12 13:19:41 -04:00
Mark Liu
b902e43892 Skip events for multi-object kubectl describe
Default ShowEvents=false when describing multiple objects and
the user has not explicitly set --show-events. Single-object
describe unchanged. Applied in both Run() and
DescribeMatchingResources() using a value copy of
DescriberSettings.

Signed-off-by: Mark Liu <mark@prove.com.au>

Kubernetes-commit: 20696e1f896b4fb013248fdb919a55e6eea75eef
2026-02-20 08:45:54 +11:00
Paco Xu
7ee58d717a kubectl: only print default cotnainer if there are multi containers
Kubernetes-commit: ec58d1865dfb4bf4cd7fc66225a84085469aeeed
2026-03-10 13:08:31 +08:00
Antoni Zawodny
21c691a386 Create Workload API v1alpha2 (#136976)
* Drop WorkloadRef field and introduce SchedulingGroup field in Pod API

* Introduce v1alpha2 Workload and PodGroup APIs, drop v1alpha1 Workload API

Co-authored-by: yongruilin <yongrlin@outlook.com>

* Run hack/update-codegen.sh

* Adjust kube-scheduler code and integration tests to v1alpha2 API

* Drop v1alpha1 scheduling API group and run make update

---------

Co-authored-by: yongruilin <yongrlin@outlook.com>

Kubernetes-commit: 3f094dc228318b89f1fef313543b960e35ca6e3e
2026-03-10 05:43:54 +00:00
Arda Güçlü
e85e61d17e Reflect expected replica count to the output of kubectl scale
Kubernetes-commit: ccd53e4eebb9e5b4daaaf7d125e4434517d887af
2026-02-11 15:12:44 +03:00
Mujib Ahasan
c2d82b2690 kubectl: add additional command suggestFor for describe and get
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>

Kubernetes-commit: 3cd3f378610f0e56d75fdeae23a8141cc8934059
2026-03-08 02:49:37 +05:30
Mads Jensen
3a2bf51acc Lint: Activate modernize/forvar rule in golangci-lint.
Kubernetes-commit: dd32d7c324b97d259b99c1464802d9e3ca706a94
2026-03-05 00:11:40 +01:00
Brian Pursley
6360299e8c Use provided context in RunLogsContext
Kubernetes-commit: 7a3c7ebcfd47b8f96fb591c37a4f633581290de6
2026-03-05 20:12:01 -05:00
Brian Pursley
23bb2d4ace Use context when waiting for conditions
Kubernetes-commit: ede65f357b5974b9ea402e611952f4a15816fdec
2026-03-05 20:39:24 -05:00
Maciej Szulik
23ac98253b De-ducplicate and clean logic in FindOrDefaultContainerByName
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: bb744ec97bd03a2115d45578468e796a557536b9
2026-03-04 11:44:25 +01:00
Arda Güçlü
c236e6d598 kubectl wait: Support multiple conditions (#136855)
* kubectl wait: Support multiple conditions

* Error out when --for is not passed

* Add examples for AND'ing and OR'ing multiple conditions

Kubernetes-commit: d37765936d2b29beede5c9a8872ccd63e2811b00
2026-03-04 21:00:27 +03:00
Mujib Ahasan
58e1f666ef Added remove in suggestFor for delete subcommnad
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>

Kubernetes-commit: 3d99d70424165eb678bb7082f3e22b2927f4384d
2026-02-27 22:22:04 +05:30
Mujib Ahasan
fa65b49f50 Added SuggestFor to top subcommand
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>

Kubernetes-commit: e70323ed25ba4e5a68fbdcbd6472270a1dbc6d0c
2026-02-27 16:42:19 +05:30
杨军10092085
a324deac7b Add --detach-keys for kubectl attach command
Kubernetes-commit: ee02a8ab32b2f25c034d76464b3909fd59a132b7
2025-10-31 14:57:46 +08:00
kfess
6ab6928019 cleanup: remove suggestfor from wait command (#137266)
* feature: remove suggestfor from wait command

* fix test case

Kubernetes-commit: 7ea5b88209020a07cc96717c6e8cb622feebdd4a
2026-03-04 23:38:27 +09:00
Arda Güçlü
67b78e8df1 List containers when given container is not found
Kubernetes-commit: 94047f3cfb7ef497995ccbc27df17254bdb8401d
2026-02-12 09:47:30 +03:00
Yosri Barhoumi
e0444cfa19 Fix example in kubectl create configmap
Signed-off-by: Yosri Barhoumi <med.yosri.brh@gmail.com>

Kubernetes-commit: d7c1072e4fd398e1ebee85a5e41ec4d8598b7d78
2026-02-03 01:49:10 +01:00
olalekan odukoya
c72d4565fb add warning when kubectl rollout undo is used on apply-managed resources
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>

Kubernetes-commit: fbe6f7f9f25a8198199af9bd75aba9d45e994b36
2026-02-17 03:05:25 +01:00
koba1t
f613e8cfbf Update kubectl kustomize to kyaml/v0.21.1, cmd/config/v0.21.1, api/v0.21.1, kustomize/v5.8.1
Kubernetes-commit: 656c0893a891c3065f5e85ab077f2eee891b33a0
2026-02-10 04:00:25 +09:00
kita456
f082187cdc Fix kubectl plugin list overshadow detection on Windows
Kubernetes-commit: 7bb838e50b5b878b19151bd03cb3e20bf8746740
2026-02-02 22:09:05 +09:00
olalekan odukoya
e366288460 add show-secret flag to the diff command
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>

Kubernetes-commit: 03060174b8e040b9cb086c7e4d613c082c34e1e8
2026-02-13 22:48:12 +01:00
olalekan odukoya
d9dc040ca9 fix cli throwing an error when trying to follow logs for pod while still initializing
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>

Kubernetes-commit: 5b3b05921f68116e8c96697766f7298d27b5a142
2026-01-22 00:51:44 +01:00
Mads Jensen
07471296e7 Fixes under staging.
Kubernetes-commit: ae8838f58a5859c33f2443b7df8a4bc525fde95b
2026-02-06 22:44:34 +01:00
Austin Abro
749aa3b298 feat(wait): introduce waitOptions.RunWaitContext() (#136781)
* run wait with context

Signed-off-by: Austin Abro <austinabro321@gmail.com>

* delete other comment

Signed-off-by: Austin Abro <austinabro321@gmail.com>

---------

Signed-off-by: Austin Abro <austinabro321@gmail.com>

Kubernetes-commit: 598922db7562f628fb51ef1db6d3ccb6003369a4
2026-02-07 00:40:56 +00:00
0x5457
a691d93fd8 Fix missing namespace flag in attach reattach message
Kubernetes-commit: c7ba4bbcf86cb6d520348e02a0ac4af5d7622501
2025-12-19 00:01:10 +08:00
Arda Güçlü
10d2309a74 Promote kubectl kuberc commands to beta
Kubernetes-commit: 4e47d34a0d2d7d420f2bf511a28b86da88e54213
2026-01-30 09:23:14 +03:00
olalekan odukoya
dc1910f50a fix kubectl in interactive mode losing some line of logs
Signed-off-by: olalekan odukoya <odukoyaonline@gmail.com>

Kubernetes-commit: f338a70f252123aa0a01cb4d53087d88295b0d41
2026-01-03 01:38:00 +01:00
Keita Mochizuki
a6e555e5b2 Update staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go
Co-authored-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 211e77a9967f241edff1c6f0116369b2d1200455
2026-01-16 23:45:12 +09:00
mochizuki875
4b1d211ade make general profile default
Kubernetes-commit: 8e420e0b3ac1e6c770a265eb2e69476576a58d43
2025-12-23 15:50:14 +00:00
杨军10092085
b365eec0f7 When using kubectl to delete multiple sts pods simultaneously, it gets stuck and won't exit
Kubernetes-commit: a14f528ffe671da721dfa80ed8774361e1fb6011
2025-12-03 12:39:32 +08:00
Jordan Liggitt
7a5dbbdd2d Fix kyaml output of watch events
Kubernetes-commit: c280c22ea49d99921f50b19d1d45bb970ae1fa85
2026-01-08 12:14:41 -05:00
Marcos Guillermo
de9c08efa2 kubectl: Fix panic in exec terminal size queue
Check if delegate is nil before calling Next() in terminalSizeQueueAdapter
to prevent a nil pointer dereference.

Kubernetes-commit: 5f675740442edc32f2dcbbe1453f49484440e7a8
2025-12-23 17:37:59 -03:00
Sonika Arora
e3aecb126e Fix typos in kubectl package comments
- Fix 'Prefrences' -> 'Preferences' in kuberc.go
- Fix 'formating' -> 'formatting' in humanreadable_flags.go

Kubernetes-commit: 7b6fbc9677afc703e058f9a9079805026af76745
2025-12-21 23:17:37 -08:00
Manuel Grandeit
c9b8fdf5d8 kubectl apply: fix --dry-run=client to show merged result
When a resource exists on the server, kubectl apply --dry-run=client
was outputting the unchanged server state instead of showing what
would result from applying the manifest.

Fix by computing the three-way merge patch (same as real apply) and
then applying it locally to the current server state.

Kubernetes-commit: aea05ad180edaffbb1f09b41b62d452779ed1da1
2025-11-29 20:15:36 +01:00
Patrick Ohly
2082ef9b6e build: remove deprecated '// +build' tag
This has been replaced by `//build:...` for a long time now.

Removal of the old build tag was automated with:

    for i in $(git grep -l '^// +build' | grep -v -e '^vendor/'); do if ! grep -q '^// Code generated' "$i"; then sed -i -e '/^\/\/ +build/d' "$i"; fi; done

Kubernetes-commit: ad79e479c2314d1de91e54bc5630c52027f12e21
2025-12-01 15:54:18 +01:00
kfess
8bbd0b01da Fixed kubectl alpha kuberc set command to preserve unspecified fields on overwrite (#135619)
* Fix kuberc set command to preserve unspecified fields on overwrite

* remove ambiguous description

Kubernetes-commit: bee2251aef5c8045033fb90fd5c0e24d50e1813a
2025-12-18 15:24:06 +00:00
Arda Güçlü
12c7166176 Move away from deprecated term.AllowsColorOutput (#135454)
* Move away from deprecated term.AllowsColorOutput

* Move away from term.IsTerminal

Kubernetes-commit: bb9bb4d4224923964f6e4ed4306450a79fee647d
2025-12-18 15:24:01 +00:00
laervn
c3ae2c23bf kubectl explain: Add -r shorthand flag for --recursive (#135283)
* kubectl explain: Add -r shorthand flag for --recursive

* kubectl explain: Change --recursive shorthand flag to R

Kubernetes-commit: 8759535363ab8f5e1c49cc4e6a5716b81e3960eb
2025-12-18 05:00:32 +01:00
Ondra Kupka
a2858d15e2 kubectl label: Add 'modified' output version
When labels are both added and removed, labels modified message is now
printed instead of labeled/unlabeled.

Kubernetes-commit: 14cf86648fad1f6e4a503d50184241928f509762
2025-10-24 12:47:17 +02:00
Ondra Kupka
6e20ab1fec kubectl label: Improve tests
Kubernetes-commit: de229210c13f8776d37f66218d8b877516a77e4f
2025-10-24 12:39:27 +02:00
Peter Engelbert
52b571c82c Add client-go credential plugin to kuberc
Remove reference to internal types in kuberc types

* Remove unserialized types from public APIs

Also remove defaulting

* Don't do conversion gen for plugin policy types

Because the plugin policy types are explicitly allowed to be empty, they
should not affect conversion. The autogenerated conversion functions for
the `Preference` type will leave those fields empty.

* Remove defaulting tests

Comments and simplifications (h/t jordan liggitt)

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>

Kubernetes-commit: fab280950dabfefabe6a8578b7a76372a9b21874
2025-10-24 16:06:33 -04:00
Arda Güçlü
cca30abc00 Introduce kuberc view/set commands under kubectl alpha (#135003)
* Introduce kuberc view/set commands under kubectl alpha

* Apply requested changes

* Apply requested changes

Kubernetes-commit: 9cad3f8787606d711ea8890398877fdfab011474
2025-11-05 13:20:31 +00:00
Arda Güçlü
76d6ad851d Add given namespace in dryrun=client output of HPA
Kubernetes-commit: c13c5814597659f84e4af61c642423d37522aec1
2025-09-25 13:15:10 +03:00
Maciej Szulik
72d3fd00c7 Clean NewDefaultKubectlCommandWithArgs for readability
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: d3c2115441e47a5168a1d5f5dd1207678d71aca8
2025-11-03 11:31:23 +01:00
Maciej Szulik
7a3ec922e4 Move PluginHandler to separate file
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: ac9120f6076217a6a033cf9a32dd89a61713c59f
2025-11-03 11:25:04 +01:00
Lukasz Szaszkiewicz
17e1b81927 watchlist: wrap remaining LW with ToListWatcherWithWatchListSemantics
Kubernetes-commit: 4fd41778b87a7a02066566cc12e3eb4a87a071ee
2025-10-10 22:44:45 +02:00
Maciej Szulik
164e47abb8 Promote KUBECTL_COMMAND_HEADERS to stable
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: f82a139dc0840b51aa41931535f5eef6fc3507b4
2025-10-22 13:56:32 +02:00