Commit graph

406 commits

Author SHA1 Message Date
Arda Güçlü
4e47d34a0d Promote kubectl kuberc commands to beta 2026-01-30 09:23:14 +03:00
mochizuki875
8e420e0b3a make general profile default 2025-12-24 15:35:31 +00:00
Peter Engelbert
fab280950d
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>
2025-11-09 14:24:53 -05:00
Arda Güçlü
9cad3f8787
Introduce kuberc view/set commands under kubectl alpha (#135003)
* Introduce kuberc view/set commands under kubectl alpha

* Apply requested changes

* Apply requested changes
2025-11-05 01:48:59 -08:00
Arda Güçlü
9113013eb8
Introduce --as-user-extra persistent flag in kubectl (#134378)
* Introduce --as-user-extra as persistent flag

* Add integration test to verify the behavior

* Update flag type to string slice
2025-11-04 07:14:09 -08:00
Arda Güçlü
c13c581459 Add given namespace in dryrun=client output of HPA 2025-11-03 18:35:45 +03:00
Maciej Szulik
f82a139dc0
Promote KUBECTL_COMMAND_HEADERS to stable
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-10-28 18:17:32 +01:00
Maciej Szulik
167ccbc8ec
Improve cmd tests for kubectl events
kube::test::if_has_string and kube::test::if_has_not_string only match
the first argument, and don't allow regular expressions, so we need to
split the checks into separate buckets, ensuring they are strictly tied
to this particular test.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-10-24 16:37:03 +02:00
Ondra Kupka
d03fab555f kubectl config set-context: Add -n flag
This is simply a shorthand for --namespace as with other commands.
2025-10-06 11:31:26 +02:00
杨军10092085
9fb1ef4dd0 fix kubectl exec command in cmd test 2025-09-02 20:04:46 +08:00
Jordan Liggitt
0c91e28360
Clean up service account print and describe 2025-08-05 17:51:10 -04:00
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