Commit Graph

19 Commits

Author SHA1 Message Date
Andreas Karis 1b4373f26b 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>

Kubernetes-commit: 41889984304c44b879d8bcae92c9ed7aa3fd8c67
2023-06-20 03:34:50 +02:00
minherz bd48fd4c16 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

Kubernetes-commit: dbdd861ea366af50fb74983426587dad7222cb89
2023-06-29 00:36:07 -07:00
minherz baf5b1c999 chore(fix): test jsonpath condition parsing errors
Test parsing logic for invalid JSONPath condition formats,
excluding JSON path expression parsing.
Fix error in parsing logic

Kubernetes-commit: a5c4fbe979188335f4f414a1aef303f1c0f353f6
2023-06-03 21:40:16 -07:00
minherz 0c921b2f35 Support JSONPath condition without value
Extend current JSONPath condition logic to return from wait on "any" value.
Change parsing JSONPath input to support the syntax without value.
Match any simple or complex (object or array) values.

Kubernetes-commit: 9d3e55ec431f3f595a7739fcc592602f7cc1d69b
2023-05-21 19:03:24 -07:00
Arda Güçlü 3f05cfcd78 Migrate genericclioptions.IOStreams usage to genericiooptions
Kubernetes-commit: 00c30941260a27e6929aef84c7fdbc8f1508518c
2023-04-05 14:07:46 +03:00
inosato 8272d71ba6 Remove ioutil from kubectl
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 774ab1349bfd553c97a99b992e9f38659f541c84
2022-07-30 22:31:16 +09:00
jonyhy96 1906bda541 feat: make jsonpath wait logics consistent with condition
Signed-off-by: jonyhy96 <hy352144278@gmail.com>

Kubernetes-commit: 7a1493be5679ed3ec85b7fdef685c7e6b580e8e4
2022-06-29 12:28:24 +08:00
Marcus Puckett 77c921aa92 Fix flakiness with kubectl wait tests (#111168)
* Prepend reactor not watch reactor

This forces the object to be created first it looks like, avoiding a race condition in testing.
Use PrependReactor instead of PrependWatchReactor

Decrease test timeouts

No need to be this long
Revert use of new scheme to reuse same scheme for all tests

Allow 1 to 2 actions in stale observed generation failure

Allow range of test action lengths

Reduce test flakiness
Fix TestWaitForJSONPathCondition/handles_watch_condition_change

Set delete wait options properly

cherry pick original changes back into branch

* Revert delete timeout setting change

* Remove validateActions functions

* Remove go-spew

Kubernetes-commit: dcc54dec19fa5f4605cf679af5289b173ce6015f
2022-07-28 20:44:55 +00:00
Marcus Puckett d9fb1ec8c6 Revert "Move kubectl wait to informers with a cache to avoid hanging due to objects disappearing from the cluster"
Kubernetes-commit: 5badb731a895dfa0a188a3f4aec2d3edfe709b12
2022-07-18 08:48:29 -07:00
Marcus Puckett 3c41b7369c Add cases for when --timeout=0 and tests
Kubernetes-commit: 61ebfdb2018b0dae4e364d0170610ccdec18b2c1
2022-07-01 16:49:31 -07:00
Marcus Puckett 533f9479cc Revert "Move kubectl wait to informers with a cache to avoid hanging due to objects disappearing from the cluster (#108086)"
This reverts commit 171431ca2c009c0a576fa288b7df892b59299389.

Kubernetes-commit: a6bd1e6ac90f3ccbbe527e44e3217a8420636c41
2022-07-01 13:45:18 -07:00
Marcus Puckett 2e38f74bcc Move kubectl wait to informers with a cache to avoid hanging due to objects disappearing from the cluster (#108086)
* move to using informers for getObjAndCheckCondition

* move to using informers for IsDeleted

* update tests to handle new informer methodology

* set minimum timeout to 1s because informer can't handle less for caching reasons

* fix null return for deletes issue

Kubernetes-commit: 171431ca2c009c0a576fa288b7df892b59299389
2022-06-30 20:54:29 +00:00
Chok Yip Lau 8d1dfaeedb Added JSONPath wait for kubectl wait
Co-authored-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 8fcf98ec3bb16ddf32ea1688752e6b7e2a14eaa4
2021-10-04 16:19:08 -04:00
Ling Samuel cf01e4558b fix kubectl wait --for=delete ignore not found
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>

Kubernetes-commit: 99cdc37e2a89df1f86045f295916c00266e4d034
2020-11-19 14:48:28 +08:00
Nick Maliwacki f3ec5d79c4 add .status.observedGeneration tests & update names
Kubernetes-commit: bca0ddeba0d669093d04a148cef4d4179e2fa271
2021-01-13 22:35:58 -08:00
Nick Maliwacki a84bbc2022 wait ensures observedGeneration >= generation
Kubernetes-commit: 44aff9917566885ab5d8cc712a3330bac1923214
2020-12-20 00:35:31 -08:00
David Eads 6cadd0558f add GVK to fake dynamic client to match actual behavior
Kubernetes-commit: f4383458432cd67714e9ce0acde56a2ed5c24a21
2020-10-29 15:53:34 -04:00
zhouya0 3c159f733a kubectl wait add ignore not found flag
Kubernetes-commit: 3d2d95e99dd1219331ef3d32e63b39122a0ef116
2020-05-11 09:19:10 +08:00
Sean Sullivan c6063dd846 Move pkg/kubectl/cmd/{command} to staging
Kubernetes-commit: 0e0ea523392f1121f61f99ac30a9bc2043eaed90
2019-08-01 11:01:40 -07:00