Commit graph

413 commits

Author SHA1 Message Date
Lubomir I. Ivanov
bc2179d882 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.
2026-04-03 16:11:09 +02:00
Peter Engelbert
b4220f8b08
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>
2026-03-12 22:49:41 +05:30
Kubernetes Prow Robot
63d25f42db
Merge pull request #136945 from ardaguclu/fix-kubectl-scale
Reflect expected replica count to the output of kubectl scale
2026-03-09 19:53:22 +05:30
Arda Güçlü
d37765936d
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
2026-03-04 23:30:27 +05:30
kfess
7ea5b88209
cleanup: remove suggestfor from wait command (#137266)
* feature: remove suggestfor from wait command

* fix test case
2026-03-04 20:08:27 +05:30
Arda Güçlü
94047f3cfb List containers when given container is not found 2026-02-12 09:47:30 +03:00
Arda Güçlü
ccd53e4eeb Reflect expected replica count to the output of kubectl scale 2026-02-11 17:44:36 +03:00
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