Commit graph

1552 commits

Author SHA1 Message Date
Marcos Guillermo
6b218dd38b 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: 72a5892dca945f000a30c7a763aa0696964b7e50
2025-12-23 17:37:59 -03: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
Konrad Kaim
946ada3b20 remove deprecated Ingress api from describe
Kubernetes-commit: 6da8d6e94d48e44df843e9633ecfb515cdadbf1e
2025-11-06 08:51:53 +00:00
Maciej Skoczeń
cc24ba554f kubectl: Add Workload to kubectl describe pod
Kubernetes-commit: 02acdd605744afc9b93aa088a5814c1d40b036fb
2025-10-10 09:43:12 +00:00
Konrad Kaim
0de0ccdd9c remove deprecated IngressClass api from describe
Kubernetes-commit: a9ff1b19c1896a456abca8088be73c7f2d37e65b
2025-11-04 16:53:26 +00: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
Konrad Kaim
3ef7371e90 remove deprecated EndpointSlice api from describe
Kubernetes-commit: bda0e6a83c5e8f5bd6ffdc22c8034498ed38fecc
2025-10-27 16:44:05 +00: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
Ricardo Pchevuzinske Katz
9424fae557 Return error in case of discovery client failure
Kubernetes-commit: f0e88857f7b5d3f56e1296b8c7b38bf4a7eee676
2025-10-23 19:28:18 -03:00
Benjamin Elder
b27fef8d9e remove deadcode HashObject from k8s.io/kubectl/pkg/util
I can't find evidence that anything is using this anymore, if anyone does depend on this it is a tiny function that depends only on public symbols and they can just place a copy somewhere else.

Kubernetes-commit: 4e29dcdf7567cd79749b7ad35378538b1b523247
2025-08-26 15:07:10 -07:00
Benjamin Elder
495c59a507 mark remaining md5 usage TODO and exclude from lint
Kubernetes-commit: 797d3165191847b60dda3d8e6822e2854462a118
2025-08-13 16:57:37 -07:00
Konrad Kaim
5fa710d18b feat: migrate off deprecated NewSimpleClientset to NewClientset
Kubernetes-commit: 724cdb5cf387e6c45ccee14d30936b4b10a88870
2025-10-23 15:33:20 +00:00
Ondra Kupka
31adc00455 kubectl: Add support for tracing
Kubernetes-commit: 1b863d81c9279449ed4c7cb0ae47c10c0b4010d2
2025-10-23 17:04:30 +02:00
Ondra Kupka
c867eb3934 kubectl: Refactor profiling helpers
Kubernetes-commit: 9d369f32a3de377c1fa0bb5c63cb490fa37038aa
2025-10-23 17:02:02 +02:00
Stephen Kitt
68036e0ad0 Avoid no-change lambdas
This replaces functions that wrap another function with no change with
a direct reference to the wrapped function.

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

Kubernetes-commit: 1e2817d5890ac5056e770cbdebdadfb7fc6ef54c
2025-09-19 16:56:00 +02:00
Konrad Kaim
35b4b2ab5f remove deprecated CertificateSigningRequests api from describe
Kubernetes-commit: 764918a4ddf92ab620c8d14b61a9f7e6f008b806
2025-10-22 15:05:52 +00:00
Thomas Hein
3f380f1291 docs: quote PowerShell completion script path ($HOME may contain spaces)
Kubernetes-commit: d7b83193c426ecf4d9a57da5c6d1eeaf838e2946
2025-10-18 04:19:32 -05:00
Thomas Hein
ec5efb5523 docs: dot-source kubectl completion script in PowerShell profile
Kubernetes-commit: 0f6bc57d1189cc7c40d751b6eb59ccdf29f1bcaf
2025-10-18 04:15:34 -05:00
Konrad Kaim
8323544905 reformat
Kubernetes-commit: 579579138c9e0e0a1732f7a59095a512a55fa6d0
2025-10-21 15:58:12 +00:00
Konrad Kaim
f388d8cd50 drop support for policyv1beta1.PodDisruptionBudget
Kubernetes-commit: f23f716af46c7f3bae2ac060167c20c956c25906
2025-10-17 15:41:17 +00:00
Qiming Teng
89f2922c93 Remove mentioning of the APISelfSubjectReview gate
Kubernetes-commit: 5362c2858de46f2e3f9838e123e9442cafe91315
2025-10-12 16:32:05 +08:00
Maciej Szulik
309b1eff04 Update --chunk-size flag, dropping the beta information
The --chunk-size flag has been around since October 2017
(i4780ad0297)
so it's about time we make it official.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>

Kubernetes-commit: cf099f4fc9028c60e62de33223492d1ef4e03585
2025-10-08 18:13:00 +02:00
Ondra Kupka
d76b915c1a kubectl config set-context: Add -n flag
This is simply a shorthand for --namespace as with other commands.

Kubernetes-commit: d03fab555f1fb77d5045f24bc4cce94ecde2bb98
2025-10-02 17:26:18 +02:00
cz21
6575dcbe31 fix(cordonhelper): Avoid mutating local node before API call
Signed-off-by: cz21 <cz21ok@gmail.com>

Kubernetes-commit: c524a5fba28b447ef0a0ef3df3eaef64e8ae8228
2025-09-28 00:21:51 +08:00
Arda Güçlü
a06bba9d57 Remove KUBECTL_OPENAPIV3_PATCH feature gate as the feature is stable
Kubernetes-commit: 9382fa8b70be73b0df83d7c2793cf8efd95ec773
2025-09-18 12:30:09 +03:00
rxinui
6f08f37cb1 print the current kubectl command encapsulated by kuberc on V(1)
Signed-off-by: rxinui <rainui.ly@gmail.com>

Kubernetes-commit: cbb7b29bc24f3c1d90f88602855ee3ca0b74d10a
2025-08-17 21:34:03 +02:00
mochizuki875
848d63d832 standardize not found error message of kubectl scale
Kubernetes-commit: bb21080626de5de93e6820e6e22ff5b3dee200f4
2025-09-11 15:45:36 +00:00
Joe Betz
413f81f8da generate
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: 5647c07179df7df9ae6775f3f7692462db93d68b
2025-09-10 15:52:58 -04:00
Joe Betz
e44a71d76e Add model name generator tags
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: e910c181cb9a91cd01a73869921ee285377aea61
2025-09-10 15:52:58 -04:00
pranshul gupta
60fa575b87 kubectl: include container fieldPath in event messages
Kubernetes-commit: 94d3dc40b2385f9c80c238c9eb049f5c879b9158
2025-08-20 15:49:49 +05:30
Nour
95e7aecac0 Replace deprecated strings.Title with cases.Title
Kubernetes-commit: 72847ee1f7571f1b8b51d4566302c62b31b1edf8
2025-08-30 18:16:59 +03:00
Arda Güçlü
93ed510007 Remove redundant experimental prefix in wait command
Kubernetes-commit: 98f81fc291039c96c65b79ef5280d76224084a87
2025-09-05 16:07:54 +03:00
Mayuka Channankaiah
a0eb08a9ac Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs
Kubernetes-commit: 6c56d2fd1bc54a7bcda84c8a83428877d9b39e96
2025-08-01 14:18:06 +05:30
Ondra Kupka
5172df9638 kubectl/logs: Add LogOptions.RunLogsContext
LogOptions.RunLogs unfortunately registers a signal handler and calls
os.Exit(1) after finished processing when a signal is received. This
makes it basically impossible to call that function from any custom
code.

This patch adds RunLogsContext, which does exactly what RunLogs does,
but the context to be used is passed in. RunLogs retains the current
contract, but it uses RunLogsContext internally, then calls os.Exit(1)
when a signal is received.

Kubernetes-commit: cc4666cc94be41d8b4558122717a2da9fb5a7b1a
2025-07-18 23:35:24 +02:00
Ondra Kupka
cf8aed98eb cli-runtime: Return defined error from Builder
There is a custom error message returned from resource.Builder when
SingleResourceType is set and multiple resources types are specified,
which makes it impossible to check for the condition in code easily.

This patch adds resource.ErrMultipleResourceTypes that is returned
precisely in this case so that it can be checked.

This patch also removes an extra custom error message in kubectl get,
which is actually never reached, because the builder fails before.

Kubernetes-commit: 82896feebbdf1c0809c0fec29988eff15cb02837
2025-08-04 22:48:57 +02:00
Marc Khouzam
aa186336f3 Fix linter
Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>

Kubernetes-commit: d194619979252d33c525e972cfaf0eea9dc64b43
2025-08-28 23:04:35 -07:00
Marc Khouzam
4dec168032 Fix completion of resource names
The output format is now used by the `Complete()` function, so it must
be set before invoking said function.

The commit also adds a unit tests for this scenario.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>

Kubernetes-commit: f3d278e75d1137f1c91dde7415bc577af3c3be82
2025-08-28 21:06:02 -07:00
Tim Hockin
21b32eea57 Change KYAML gate to on-by-default
Kubernetes-commit: 5af2b732beeae755c5a87b423659ab46968f4a14
2025-07-30 17:49:33 -07:00
Arda Güçlü
3c19b8deb3 Drop experimental prefix from kubectl wait command
Kubernetes-commit: ff37d8c33945b5c369f40baa1884632cfd0d32c5
2025-08-27 18:36:35 +03:00
Vishnu Mohan
cbe60c952e kubectl: fix expose --selector help text
The current help text wordings incorrectly suggests inference only works for RC/RS when it actually works for Pods and Deployments too

Update help text to accurately reflect that selector inference works
for any resource being exposed, as documented in main expose help.

Kubernetes-commit: 5c8f26f48032899031760e5b75ad259d23d312b2
2025-08-19 01:19:07 +05:30
Caleb Woodbine
12dc58ebf7 chore: update CronJob casing for create job help
use the resource Kind casing for `CronJob` in the note for the `from` argument help

Kubernetes-commit: 76e5929d1a140678f94964142e4cc1566dd1a90c
2025-08-18 11:42:40 +12:00
Benjamin Elder
4b52eef334 fix deprecation formatting for k8s.io/kubectl/pkg/cmd/config.NewCmdConfigSetAuthInfo
Kubernetes-commit: 1dd428d4c0140fd3957c30cb716f710718486aab
2025-08-15 10:55:45 -07:00
Lorain
9e0a26615e fix using stale pod when evict failed and retry (#133461)
* fix using stale pod when evict failed and retry

* simplify pod refresh process

* use activePod at getPodFn

* fix lint check

* add ut

* introduce EvictErrorRetryDelay

Kubernetes-commit: 66fdbe105831e08b588dd01039a7e3130fd2d36f
2025-08-28 04:54:34 +00:00
Mikhail Mazurskiy
ce4d90902a Decouple term and remotecommand packages
This allows consumers of term to not pull in dependencies on
github.com/gorilla/websocket and github.com/moby/spdystream.

Kubernetes-commit: 640dabd58b04b72f646ed85947cb8b407b36dc08
2025-08-03 20:35:40 +10:00
Jordan Liggitt
5c587a03ba Make kubectl auth reconcile retry on conflict
Kubernetes-commit: 3b0a85170a76f419be05c40a866e10c3b760195b
2022-05-28 11:04:14 -04:00
Jordan Liggitt
a7bf48f663 Clean up service account print and describe
Kubernetes-commit: 0c91e28360dd9f4caae4ed9d1aea4ceeca4aedcb
2023-04-07 09:54:24 -04:00