Commit Graph

382 Commits

Author SHA1 Message Date
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
m.nabokikh
7c5573d326 Fix cmd, integration, and conformance tests
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2023-05-03 01:29:37 +02:00
m.nabokikh
40de26dcff KEP-3325: Promote SelfSubjectReview to GA
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2023-05-02 14:50:40 +02:00
Arda Güçlü
457bb58ebb kubectl events: Support fully qualified names for --for flag
Users can pass resources into `kubectl events` command via `--for` flag,
if they have desire to only get events for the resource they specify.

However, current `kubectl events` does not support passing fully qualified
names(e.g. `replicasets.apps`, `cronjobs.v1.batch`, etc.). This PR adds support
for this.
2023-03-31 12:34:00 +03:00
Shang Ding
177905302e add integration tests for debug profiles general & baseline 2023-02-21 17:43:03 -06:00
Arda Güçlü
6c346e6cc9 Re-enable label selector 2023-02-20 09:10:51 +03:00
Arda Güçlü
6e8a1beda7 Add integration test for diff --prune --selector
This PR adds new integration tests for `kubectl diff --prune -l` to
catch possible regressions in the future.
2023-02-20 09:10:50 +03:00
Kubernetes Prow Robot
1749bb2991 Merge pull request #115579 from ardaguclu/fix-wait-sh-timeout
flaky test wait.sh: Add deployment assertion before running wait
2023-02-10 13:59:29 -08:00
Arda Güçlü
e0fedec69d (kubectl debug): Support debugging via files
Currently `kubectl debug` only supports passing names in command line.
However, users might want to pass resources in files by passing `-f` flag like
in all other kubectl commands.

This PR adds this ability.
2023-02-10 10:21:30 +03:00
Arda Güçlü
60401d35d1 flaky test wait.sh: Add deployment assertion before running wait
There is a test in wait.sh integration suite which is checking the
given timeout value(passed by user) is equal to actual happened timeout value.

However, this test rarely gets `no matching resources found` error and
causes flakyiness. The reason is we are running wait command, immediately
after applying deployment. In reality, timeout test does not care about
deployment, since it is testing the timeout by passing invalid configurations.
But we need this deployment to not get `no matching resources found` error.

That's why, this PR adds deployment assertion before executing wait command.
2023-02-07 14:19:34 +03:00
Kubernetes Prow Robot
12c71fdf1c Merge pull request #113542 from ardaguclu/fix-shortname-disperancy
Set singular names for core types to pass to discovery
2023-01-03 09:29:43 -08:00
Kubernetes Prow Robot
4a5d8a4b08 Merge pull request #114627 from ardaguclu/fix-discovery-flaky
Ignore api-resources not found error until it's ready
2022-12-21 13:53:40 -08:00
Arda Güçlü
a5698efff2 Ignore api-resources not found error until it's ready 2022-12-21 10:34:53 +03:00
Maciej Szulik
132f8127a3 Fix wait test timeout 2022-12-20 17:02:23 +01:00