Commit graph

4162 commits

Author SHA1 Message Date
Kubernetes Publisher
d3c92e6b86 Merge pull request #138562 from dims/update-cbor-dep
Update github.com/fxamacker/cbor/v2 to v2.9.1

Kubernetes-commit: 6e4605d14e04ea9681b6dd6b5729c788e28e89b7
2026-04-24 12:24:37 +00:00
Kubernetes Publisher
1bd8f21ffe Merge pull request #138561 from dims/update-xnet-dep
Update golang.org/x/net to v0.53.0

Kubernetes-commit: 1f22abeebcb4e1ecae2f3dbcf3f0cd747ecfb3d6
2026-04-24 12:24:36 +00:00
Davanum Srinivas
f8f46ea66d Update github.com/fxamacker/cbor/v2 to v2.9.1
Parser hardening for the kube-apiserver CBOR deserializer (PRs #750,
#753, #757): fixes tag-1 epoch float64 overflow into time.Time fields
(directly reachable via DecTagOptional decode path), RawMessage clone
defense, and keyasint type-confusion fixes.

Kubernetes-commit: dc29a934e460eb29130de6724787ca1b677e31e0
2026-04-23 21:43:02 -04:00
Davanum Srinivas
8f8d114f81 Update golang.org/x/net to v0.53.0
Fixes CVE-2026-33814 (golang/go#78476): HTTP/2 Transport hangs
indefinitely when a peer sends a SETTINGS frame with MaxFrameSize=0.
This is reachable from kube-apiserver's OIDC, admission webhook,
and aggregated API client paths.

Kubernetes-commit: 12a2470693d86f63f4614048ffdd43dc393dd7e0
2026-04-23 21:36:05 -04:00
Kubernetes Publisher
07b2c1d143 Merge pull request #138291 from soltysh/drop_generators
Drop generators from kubectl run

Kubernetes-commit: 5ad3251400fa9e830828b35436c0a4d8fbbf7984
2026-04-23 22:17:48 +00:00
Kubernetes Publisher
63f12ca074 Merge pull request #138192 from skitt/otel-1.42
Bump otel to 1.43.0 and contrib to 0.68.0

Kubernetes-commit: 5ed1fd971d594a3cda7f7e26cd037e8be37f520f
2026-04-23 22:17:46 +00:00
Maciej Szulik
3fe5e3bbf1 Drop generators entirely from kubectl
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: 2e7089b46420f6d98cc67086ba6b0c1f364798d1
2026-04-08 17:14:35 +02:00
Maciej Szulik
a174022b42 Remove generators from kubectl run
Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: e7ad4d65fe4f0364169311588986f22115be077d
2026-04-08 17:48:21 +02:00
Stephen Kitt
c128a9a956 Bump otel to 1.43.0 and contrib to 0.68.0
See
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.41.0
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.42.0
https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.43.0
and
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.41.0
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.42.0
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.43.0
for details.

otelgrpc no longer produces "messages" span events so these are
removed from the tracing test.

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

Kubernetes-commit: 1a63916abee48d6356fbc2e6965433647e6cf073
2026-04-03 10:10:53 +02:00
Kubernetes Publisher
60ec487e8f Merge pull request #138499 from soltysh/double_quote_command
Ensure the path inside the container is correctly handled

Kubernetes-commit: 5c0362e8d1d636816423e90459e3b021022ee62e
2026-04-23 22:17:44 +00:00
Kubernetes Publisher
ef67d87dbf Merge pull request #138480 from xigang/errors_format
fix: properly format DebugError output in kubectl StandardErrorMessage

Kubernetes-commit: 44aaa8e169f7cd6a8b8c3ac38ab660240bbe2a5f
2026-04-23 03:27:06 +00:00
Kubernetes Publisher
be1551afc8 Merge pull request #138262 from brianpursley/remove-CreateSubcommandOptions
kubectl: Remove unused CreateSubcommandOptions from create.go

Kubernetes-commit: e21ce5e0bc52d61da6531d2a285caf2112ee7bfe
2026-04-23 03:27:04 +00:00
Leoy
39dad5862b kubectl: use %w for error wrapping and remove redundant .Error() calls (#138223)
* kubectl: use %w for error wrapping and remove redundant .Error() calls

Replace fmt.Errorf with %s and err.Error() with idiomatic %w wrapping
in kubectl's polymorphichelpers, wait, and drain packages. This enables
proper error chain inspection via errors.Is/As and follows Go best
practices.

Also fixes a typo: "Statefulset" -> "StatefulSet" in history.go.

* Address review: use %w for error wrapping in extendErrWaitTimeout

Use fmt.Errorf with %w instead of %v to preserve the error chain,
allowing wait.Interrupted() to correctly detect timeout errors.

Signed-off-by: supermario_leo <leo.stack@outlook.com>

* Fix lint: wrap both errors with %w in cordon error path

The linter flags err used with %v when it is an error type. Since
Go 1.20+ supports multiple %w verbs in a single fmt.Errorf call,
wrap both err and patchErr to preserve both error chains.

Signed-off-by: supermario_leo <leo.stack@outlook.com>

---------

Signed-off-by: supermario_leo <leo.stack@outlook.com>

Kubernetes-commit: d916c320deb859cd264354c48f3bd5419f7a2950
2026-04-23 08:37:22 +08:00
hunshcn
b600e51f90 kubectl: strict check for exec command (#138214)
* kubectl: strict check for exec command

Fix https://github.com/kubernetes/kubectl/issues/1745

The current implementation doesn't properly check for arguments between
the resource name and the dash separator. This can lead to unexpected
behavior when using commands like 'kubectl exec -it pod-0 bash -- run.sh',
which should raise an error but doesn't.

This fix ensures that when a dash separator (--) is used, there are no
extra arguments between the resource name and the dash.

- Only allow argsLenAtDash == 0 or == 1 (exactly one arg before --)
- Add test for extra args between pod and --
- Add test for flag-like args without dash separator

* test: add kubectl exec container flag coverage

* Apply suggestion from @soltysh

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

---------

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

Kubernetes-commit: b528be0a5658083db98e4a757483a36e1a83e27c
2026-04-23 08:37:14 +08:00
Kubernetes Publisher
51961f2e20 Merge pull request #138189 from ogormans-deptstack/fix/kubectl-create-run-to-rune
Remove *cobra.Command dependency from kubectl create's RunCreate

Kubernetes-commit: a5744f0a29ed3ac1131d0b68f0dd74fb696b2584
2026-04-23 03:27:00 +00:00
Ahmad Maha
76619b0639 kubectl: honor --label-columns with custom-columns (#138094)
* Honor --label-columns for custom-columns output

* Validate --label-columns with custom-columns

* Remove label-columns support from custom-columns

Kubernetes-commit: 1168c4e832f0ad12b0c11b96d15e93eb3c6a8907
2026-04-23 03:26:58 +00:00
Takehiro Ogura
7aefd5b71b Update po, mo files for kubectl Japanese translation (#131176)
* Update Japanese translation for kubectl

* Update test for kubectl help

* apply kubernetes translations rules https://kubernetes.io/ja/docs/contribute/localization/#basic-policy

* Update kubectl help test string

* rebuild kubectl mo file

* fix k8s specific terms to original one

Kubernetes-commit: 37be90f2959691c6d527ebb545675e66c1aac4c7
2026-04-23 05:48:41 +09:00
ogormans-deptstack
0338767df8 Discard unused return from cmd.Flags().Set in test
Signed-off-by: ogormans-deptstack <sean.ogorman@deptagency.com>

Kubernetes-commit: f11acbe3d9d199f6f0fbea73a94a618db63a176f
2026-04-22 09:45:15 +01:00
xigang
9372aa7db9 fix: use klog.Infof to properly format DebugError output in StandardErrorMessage
Signed-off-by: xigang <wangxigang2014@gmail.com>

Kubernetes-commit: 03b523ace7bcf4643da17c835b8545235cd524a0
2026-04-20 17:54:44 +08:00
ogormans-deptstack
c367c1bfc5 Add unit test for editOptions initialization in Complete()
Verify that editOptions is populated when EditBeforeCreate is true
and remains nil otherwise. Also verify that RunCreate returns a
clear error when called without Complete().

Kubernetes-commit: f3318c86571530c1e31013162ea6561371134a4f
2026-04-16 17:39:25 +01:00
Kubernetes Publisher
efd8ecc992 Merge pull request #138346 from dashpole/update_otel_prop
Update go.opentelemetry.io/otel to v1.41.0

Kubernetes-commit: eb51fbf7c6de0e361504729feabdadd178cd2b7b
2026-04-14 21:01:34 +00:00
Kubernetes Publisher
50157eb9cd Merge pull request #138354 from dims/update-moby-spdystream-v0.5.1
Update github.com/moby/spdystream from v0.5.0 to v0.5.1

Kubernetes-commit: 02b979213695b4e3d707ceb5a79095ae7d81b7a0
2026-04-14 21:01:33 +00:00
Davanum Srinivas
072ab7a0e0 Update github.com/moby/spdystream from v0.5.0 to v0.5.1
Kubernetes-commit: 7e9c2c8eef26f99aa2f94d8e09d6d32de86c7769

Kubernetes-commit: f6209104d25a6c0ea7605a73b9ec4085aacbca03
2026-04-13 13:57:52 -04:00
David Ashpole
84680786c0 update go.opentelemetry.io/otel to v1.41.0
Kubernetes-commit: feda787db4c9ebb53621afb83d0e486b39a14e76
2026-04-13 14:23:49 +00:00
Brian Pursley
a83cc50347 Remove unused CreateSubcommandOptions from create.go
Kubernetes-commit: 500ceb2c5c5b782b5021a18b44f6cd1aab7b3b22
2026-04-07 16:20:26 -04:00
Kubernetes Publisher
8144b746a4 Merge pull request #138199 from neolit123/1.36-fix-pause-image-drift
pause: fix version drift and enforce full SemVer validation

Kubernetes-commit: 093c91d2264ad9c4b965ad6dd27b3089681b0d73
2026-04-06 19:23:50 +00:00
ogormans-deptstack
2347603eff Remove *cobra.Command from RunCreate to enable library use
Move EditOptions construction into Complete() where cmd is naturally
available, so RunCreate no longer needs a cobra.Command parameter.
Third-party callers can now invoke RunCreate(f) without constructing
a command. EditBeforeCreate is handled via pre-built editOptions.

Also extract CreateAnnotation from cmd flags in Complete() to remove
the remaining cmd dependency from RunCreate.

Kubernetes-commit: 40843a4d0a1b992154571c3308c43d4d87186239
2026-04-04 20:15:41 +01:00
Lubomir I. Ivanov
1458cb7a54 pause: fix version drift in various files
The latest pause version is 3.10.2 but due to the introduction
of the PATCH level version to the pause image (previously was
only MAJOR.MINOR), various files have remained on an older
version. Either 3.10 or 3.10.1. Our validation with
build/dependencies.yaml ./hack/verify-external-dependencies.sh
did not account for that.

Kubernetes-commit: bc2179d8824f41bce3e25bf563e7164989d094ea
2026-04-03 16:01:49 +02:00
Kubernetes Publisher
82a3c05422 Merge pull request #137906 from aramase/aramase/c/grpc_v1.79.0
update google.golang.org/grpc to v1.79.3

Kubernetes-commit: e00eb8f394b92630827e95d22b9185d72d70d906
2026-03-20 00:11:53 +00:00
Anish Ramasekar
efc77af9a0 update google.golang.org/grpc to v1.79.3
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: f5d48853c511a99d3e8a734bce5a7926f7bdfdfb
2026-03-19 11:26:57 -05:00
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
Kubernetes Publisher
3aa1fee938 Merge pull request #137849 from bryantbiggs/deps/update-kube-openapi
deps: Update `kube-openapi` to drop `ginkgo/gomega` indirect deps

Kubernetes-commit: ec68099e62c85901c8d225705d55adfac26cf69d
2026-03-18 21:37:20 +00:00
Kubernetes Publisher
f1a9fe21da Merge pull request #131744 from ArangoGutierrez/dra_describe
Add ResourceSlices field to kubectl describe node

Kubernetes-commit: e7a3b09a0366f348f0e090fad656ffef2f8b8260
2026-03-18 21:37:17 +00:00
Kubernetes Publisher
abf88630f4 Merge pull request #137843 from pacoxu/cobra-v1.10.2
bump spf13/cobra to v1.10.2

Kubernetes-commit: cf09296f9ab90e5a8855105c270fdc57546e94a0
2026-03-18 17:34:27 +00:00
Kubernetes Publisher
5444625a39 Merge pull request #136988 from pedjak/kubectl-explain-extradocs
kubectl explain: render externalDocs from OpenAPI v3 schemas

Kubernetes-commit: 1baff9532430ff2fc94dd888aeff3817923428ac
2026-03-18 17:34:24 +00:00
Bryant Biggs
ea4d065c85 dependencies: bump kube-openapi to drop ginkgo/gomega indirect deps
Bump k8s.io/kube-openapi to pick up kubernetes/kube-openapi#579 which
moved the last ginkgo/gomega tests to stdlib testing and ran go mod
tidy, removing ginkgo/gomega from kube-openapi's go.mod.

This drops ginkgo/gomega as indirect deps from apimachinery. It also
prunes Masterminds/semver, google/pprof, and golang.org/x/tools from
client-go and other staging modules where they were only needed
through kube-openapi's ginkgo/gomega chain.

Contributes to kubernetes/kubernetes#127888

Kubernetes-commit: 56cd74d879f1ba11aadcff95326f17a1cc2c82ef
2026-03-18 09:09:11 -05:00
Paco Xu
559d096a96 bump spf13/cobra to v1.10.2
Kubernetes-commit: a304826799f652da7944937758a177e9f8970ba6
2026-03-18 16:46:23 +08:00
Kubernetes Publisher
e12c2a86e0 Merge pull request #137742 from dims/dsrinivas/issue-137739-drain-timeout
kubectl/drain: widen namespace termination retry timeout

Kubernetes-commit: 23e0d392cebf6eb434de81e5b7a4b2494d5fac53
2026-03-17 14:29:39 +00:00
Davanum Srinivas
e67d906fc9 kubectl/drain: widen namespace termination retry timeout
TestEvictDuringNamespaceTerminating intentionally exercises the retry path
but only allows 10ms of total time. The production loop sleeps, refreshes
state, and retries under that same deadline, so a single retry plus
scheduler jitter is enough to exhaust the budget under -race or on busy
CI workers.

Keep the retry interval small so the test still covers the retry behavior,
but widen the overall timeout so the assertion measures semantics instead
of machine speed.

Tested:
go test -race ./staging/src/k8s.io/kubectl/pkg/drain -run TestEvictDuringNamespaceTerminating -count=100

Kubernetes-commit: 77f8d7c2a9571dd9a76ee1be8b234a4dddd2ad35
2026-03-14 10:11:26 -04:00
Kubernetes Publisher
3b3daf56ef Merge pull request #137683 from ndixita/ippr-kubectl
Bug fix - consider status resources when computing total resources

Kubernetes-commit: cf291323c2d614dd1a66837bed853c3967449b16
2026-03-17 14:29:36 +00:00
Kubernetes Publisher
be18aaf83e Merge pull request #137706 from scaliby/extract-resource-under-describe
Extract resource under describe to a separate variable

Kubernetes-commit: 2fd6c4765634e7cc6ca7a24b61381bd779b5f9d3
2026-03-17 14:29:34 +00:00
Kubernetes Publisher
d449ccb37a Merge pull request #137298 from dims/dsri/cri-streaming-option-a-hardcut
cri streaming option a hardcut - add new staging repositories `streaming` and `cri-streaming`

Kubernetes-commit: 2bd6c7fe3cb8663804dc6e7672ff01aeebc97274
2026-03-17 14:29:23 +00:00
Konrad Kaim
0baa87b5bf feat: extract resource under describe to a separate variable
Kubernetes-commit: 93755d411b324db8f1f2b35e8132dc7f6330d35a
2026-03-13 09:03:33 +00:00
Kubernetes Publisher
0f1984aa09 Merge pull request #137470 from brianpursley/fix-wait-panic
Check condition cast to avoid potential panic in kubectl wait

Kubernetes-commit: 4221620945b1f1f73f651c7936456baffcf0327f
2026-03-13 05:41:55 +00:00
ndixita
4765ab4034 Setting UseStatusResources when fetching total pod requests and limits
Kubernetes-commit: 97f00d18eebca2ee3f69531db3142177b981f240
2026-03-12 22:32:43 +00: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
Kubernetes Publisher
9830f40c5e Merge pull request #136792 from rata/userns-goes-ga
feature: Migrate UserNamespacesSupport to GA

Kubernetes-commit: f7f694e5e066149a41a7f94394f84977fc6d0ea6
2026-03-12 21:56:25 +00:00
Kubernetes Publisher
6651a5703f Merge pull request #137145 from mark-liu/kubectl/describe-events-cardinality
Skip events for multi-object kubectl describe

Kubernetes-commit: a7cbc9054b4526d84a079261e648a9c004d5710c
2026-03-12 21:56:23 +00:00
Kubernetes Publisher
24fc121a00 Merge pull request #137591 from pacoxu/kubeadm-etcd-version
kubectl: only print default cotnainer if there are multi containers

Kubernetes-commit: 9cfdbc0d6ecfaaab403c8ce34d2967751519af12
2026-03-12 19:41:53 +00:00
Kubernetes Publisher
508904fd59 Merge pull request #137495 from pohly/klog-update
dependencies: klog v2.140.0

Kubernetes-commit: 9d0495ec93f7942b9fd6482df79820376a447eee
2026-03-10 17:45:15 +00:00