395 Commits

Author SHA1 Message Date
ArkaSaha30
621482d68b update pause version to 3.10.1
This commit will update the pause version to 3.10.1 as per thread: https://kubernetes.slack.com/archives/CJH2GBF7Y/p1741674313893029

Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
2025-07-09 16:38:14 +05:30
Maciej Szulik
690790257f Add test verifying KUBECTL_KUBERC can be turned on and off
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-06-17 11:47:17 +02:00
Arda Güçlü
b0370c483a Promote kuberc to beta
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-23 10:56:59 +02:00
Maciej Szulik
8cf5e8db78 Deprecate kubeconfig's preference field in favor of kuberc
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-20 13:31:57 +02:00
Maciej Szulik
e3f3da5e79 Swap KUBECTL_COMMAND_HEADERS to use the proper feature gate mechanism
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-08 19:11:36 +02:00
Arda Güçlü
6cca37b36f Add integration test for log verbosity 2025-05-08 16:47:35 +02:00
Keita Mochizuki
07a275437f kubectl debug: Display a warning message that the debug container's capabilities may not work with a non-root user (#127696)
* Add warning message about capabilities of debug container

* fix1

* fix2

* fix3
2025-03-19 00:50:30 -07:00
Arda Güçlü
c7a90b670c Introduce kuberc as new flag to customize defaulting and define aliases in kubectl (#125230) 2025-02-11 12:05:58 -08:00
Patrick Ohly
a85f489b28 client-go/transport: structured, contextual logging
The revised logging emits one log entry at the start of
round-tripping ("Request") and another at the end ("Response"). This avoids the
risk that related output gets interleaved by other output.

No API changes are necessary. A contextual logger is picked up from the context
of the request that is being handled. The verbosity level of that logger is
checked to determine what is supposed to be logged. This enables reducing log
details on a by-request basis by storing a `logger.V(1)` in the context of the
request.

As before, logging only gets injected into request processing at -v6 or higher,
so normally there is no additional overhead.
2025-01-27 09:45:04 +01:00
Omer Aplatony
0cc9262200 kubectl: fix wait --for=create to work correctly with label selectors (#128662)
* kubectl: fix wait --for=create to work correctly with label selectors

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* Add unit test

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* add integration test

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* Increase wait time to 40 seconds

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

---------

Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2024-12-12 02:57:28 +00:00
googs1025
573f0d4538 flake(kubectl): fix run_kubectl_request_timeout_tests in integration test 2024-10-16 20:44:25 +08:00
David Eads
55ba8b2cbb add --subresource to kubectl apply 2024-10-02 13:28:29 -04:00
Maciej Szulik
fad6c424ac wait: don't lowercase condition in --for argument 2024-08-12 16:59:17 +02:00
Kubernetes Prow Robot
37f733a657 Merge pull request #125868 from soltysh/wait_for
Add --for=create option to kubectl wait
2024-07-11 05:03:17 -07:00
Kubernetes Prow Robot
c20aa764d7 Merge pull request #125333 from ardaguclu/kep-4292-beta
KEP-4292: Preparations to promote custom profiling in kubectl debug
2024-07-11 05:03:03 -07:00
Maciej Szulik
aaf1fb50f3 Add --for=create option to kubectl wait 2024-07-08 14:07:26 +02:00
HirazawaUi
c29a19610a add tests 2024-06-26 01:07:24 +08:00
Kubernetes Prow Robot
da479a82eb Merge pull request #125630 from liggitt/rollback-wait
Revert kubectl wait regression
2024-06-21 11:21:01 -07:00
Arda Güçlü
6f4e97e905 Remove deprecated kubectl exec command execution without dash (#125437)
* Remove deprecated kubectl exec command execution without dash

* Use command execution with dash in kubectl exec

* Modify unit tests to only use command after dash
2024-06-21 09:22:55 -07:00
Jordan Liggitt
b0fb79364a Add test for wait with 0 timeout 2024-06-21 12:19:13 -04:00
Jordan Liggitt
8d67437865 Revert "Add new --wait-for-creation flag in kubectl wait command"
This reverts commit e24b9a022f.
2024-06-21 12:13:08 -04:00
Arda Güçlü
890ae1e158 Add integration tests for custom profiling in kubectl debug 2024-06-05 10:18:20 +03:00
Arda Güçlü
e24b9a022f Add new --wait-for-creation flag in kubectl wait command
kubectl wait command errors out when the waited resource does not exist.
But we need to provide a way to the users about intentionally also waiting for
the creation of resources.

This PR introduces a new flag to cover waiting for the creation of resources
with preserving the default behavior.
2024-06-03 13:31:35 +03:00
Lubomir I. Ivanov
5e290ebc90 switch k/k to pause version 3.10 2024-05-24 10:02:51 +03:00
Ahmad Zolfaghari
834658cb26 Fix kubectl explain bug when additionalProperties in schema defines as boolean. (#124506)
* Fix kubectl explain bug when additionalProperties in schema defines as:
`additionalProperties: true` to ignore iterating.

* trigger error on kubectl explain with integration test on crd with non bool additionalfields

* add changes to fix the problem

* replace sleep with loop and retry for kubectl explain integration test

* replaced testdata file with inline create
2024-05-21 04:40:32 -07:00
mochizuki875
b63fa1300c Add keep options 2024-05-16 17:26:20 +00:00
Kubernetes Prow Robot
39b085d936 Merge pull request #121725 from cubxxw/patch-1
fix: code style untidy  and update version.sh
2024-03-05 18:29:44 -08:00
Tim Hockin
5f490b4fe8 Clarify, document KUBE_OUTPUT_* variables 2024-02-29 22:05:42 -08:00
Tim Hockin
a7cf7fe55a Bump shellcheck to 0.9.0
Fix everything it flagged.
2024-01-26 16:26:40 -08:00
yulng
06679402e7 remove PruneWhitelist, use prune-allowlist instead
Signed-off-by: yulng <wei.yang@daocloud.io>
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2023-12-15 11:51:14 +08:00
Xinwei Xiong
090b79f65d Update version.sh 2023-11-04 17:22:30 +08:00
Arda Güçlü
074a8b0084 KEP-3638: Promote plugin resolution to beta (#120663)
* Promote plugin resolution to beta

* Not use plugin for kubectl create -f command execution

`kubectl create -f` is legitimate command execution and we shouldn't
search plugins if user invokes this.

* Add integration test for plugin resolution for create command

* Reintroduce feature flag to ability to disable it explicitly
2023-10-23 13:41:38 +02:00
Kubernetes Prow Robot
68d55bc4fb Merge pull request #120416 from ardaguclu/move-interactive-delete-beta
KEP-3895: Promote interactive delete to beta
2023-10-23 12:30:44 +02:00
Kubernetes Prow Robot
b4fd162664 Merge pull request #118647 from mochizuki875/fix_netadmin_debugging_profile
Add CAP_NET_RAW to netadmin debugging profile
2023-10-19 09:31:16 +02:00
Arda Güçlü
a504aed54d Add shortname ambiguity warning in shortcut expander (#117668)
* Add warning handler callback function in shortcut expander

Currently, errors in client-go are propagated back to the callers via
function returns. However, there is no elegant way for just warning users.
For example, when user wants to get a resource with it's short name format
and if there are multiple resources belonging to this short name, we need to
warn user about this ambugity which one is picked and which ones are discarded.

Not only to overcome this particular case mentioned above, but also propose a
way for the possible warnings in the future, this commit adds a warningHandler
callback function in shortcutExpander.

* Add warningPrinter functionality in ConfigFlags

ConfigFlags has neither warning user in a standardized
format functionality nor passing warning callback functions to other upper level
libraries such as client-go.

This commit adds an ability that user can set warningPrinters
according to their IOStreams and this warningPrinters will be used
to raise possible warnings happening not only in cli-runtime but
also in client-go.

* Pass warning callback function in ConfigFlags to shortcutExpander

This commit passes warning callback function to print possible
warnings happened in shortcut expander to warn user in a
standardized format.

* Add integration test for CRDs having ambiguous short names

This commit adds integration test to assure that warning message
related to this ambiguity is printed when resources are being retrieved via their short name
representations in cases where multiple resources have same
short names.

This integration test also ensures that the logic behind which resource
will be selected hasn't been changed which may cause disperancies in
clusters.

* Remove defaultConfigFlag global variable

* Move default config flags initialization into function

* Skip warning for versions of same group/resource

* Run update-vendor

* Warn only once when there are multiple versions registered for ambiguous resource

* Apply gocritic review

* Add multi-resource multi-version ambiguity unit test
2023-10-11 17:04:11 +02:00
mochizuki875
e22f8ed553 add CAP_NET_RAW to netadmin profile and remove privileged 2023-09-14 08:55:58 +00:00
Arda Güçlü
e8564d6c5b KEP-3895: Promote interactive delete to beta 2023-09-05 11:16:30 +03:00
ithrael
39e433891b fix(test): delete cronjobs.v1.example.com pi for clean up 2023-09-01 23:13:26 +08:00
ithrael
36e33cd88e fix(test): Remove 'shortNames' Property from CronJob Fields in e2e-test 2023-09-01 22:16:06 +08:00
ithrael
903156daa2 fix(test): add e2e-test for kubectl events filter by GroupVersion 2023-08-31 23:51:54 +08:00
Kubernetes Prow Robot
d486180eb0 Merge pull request #118748 from andreaskaris/kubectl-wait-for
Kubectl: Improve conditionFuncFor expression parsing for wait --for jsonpath
2023-08-15 15:17:26 -07:00
Andreas Karis
4188998430 Improve conditionFuncFor expression parsing for wait --for jsonpath
Make it possible to parse jsonpath filter expressions: Split
jsonpath expressions on single '=' only and leave '==' as part of the
string.

Reported-at: https://github.com/kubernetes/kubernetes/issues/119206
Signed-off-by: Andreas Karis <ak.karis@gmail.com>
2023-07-23 15:54:28 +02:00
Arda Güçlü
3267dd9d52 kubectl delete: Introduce new interactive flag for interactive deletion (#114530) 2023-07-11 06:05:11 -07:00
Maciej Szulik
3f07fc3acc Remove long/golang version information making short the default 2023-07-07 18:46:34 +02:00
Kubernetes Prow Robot
00b8a0a95b Merge pull request #118160 from minherz/master
Support JSONPath condition without value
2023-07-04 00:26:52 -07:00
minherz
dbdd861ea3 chore: address review feedback
add integration test to wait for json without value
refactor JSON condition value parsing and validating
adjusting test to reflect the error message refactoring
2023-06-29 00:36:07 -07:00
Mihai Costea
e6bc945a61 Add startup probe in integration test 2023-06-09 08:49:31 +03:00
Kubernetes Prow Robot
82f7cf6010 Merge pull request #117930 from LronDC/master
kubectl: optimize usage message of commands which have subcommands.
2023-06-01 02:19:46 -07:00
LronDC
15678e4a67 Optimize usage message of commands which have subcommands.
Signed-off-by: LronDC <lun.su@daocloud.io>
2023-05-26 10:07:43 +08:00
Keita Mochizuki
0813904404 Fix: Restricted profile comply with PSS (#117543)
* restricted profile comply with PSA v1.27

* add test case

* Reflect review comments

* Reflect review comments 2

* Reflect review comments 3
2023-05-24 04:16:49 -07:00