Commit Graph

36 Commits

Author SHA1 Message Date
Lukasz Szaszkiewicz
2c9d749027 reflector: close an established watcher when the StopCh was closed
Kubernetes-commit: 26f113be2fc71c7a41a59145eee5d4da9d062b9e
2023-10-03 13:49:21 +02:00
scott
6c7d1bc996 Add WithAlloc interface and stub implementations with base benchmarks
Kubernetes-commit: b8a3bd673dc61b4d7a0ad0f54fa423e0160078cf
2023-05-27 17:57:35 -04:00
Marcel Zieba
bae10246dd Improve backoff policy in reflector.
Before, we've used two separate backoff managers for List and Watch
calls, now they share single backoff manager.

Kubernetes-commit: 337728b02559dec8a613fdef174f732da9cae310
2023-05-19 14:28:31 +02:00
Lukasz Szaszkiewicz
d1c260eddc reflector: introduce watchList
Kubernetes-commit: 2fed6b8a19dde62fb6824aa9d008baedf51c2466
2023-03-09 14:08:58 +01:00
xuzhenglun
7685b51912 Fix bug in reflector not detecting "Too large resource version" error before 1.17.0
Kubernetes-commit: 11e5e92dc65c1caaeb248a60d90ccc8e29eb9ff0
2023-01-16 11:36:28 +08:00
Andy Goldstein
fbb7f087d1 reflector: refactor setting typeDescription & expectedGVK
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 784ec157e67c86bc3383b326bbfe8ee70737aa4d
2022-12-02 12:39:58 -05:00
Andy Goldstein
37897aff8d Reflector: support logging Unstructured type
Add an annotation that can be added to the exampleType passed to
NewReflector to indicate the expected type for the Reflector. This is
useful for types such as unstuctured.Unstructured, which, when used with
a dynamic informer, do not have their TypeMeta filled in.

Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 474fc8c5234000bce666a6b02f7ffbb295ef135f
2022-08-17 15:49:26 -04:00
Marcel Zięba
ff6bf679aa Add option to retry internal api error in reflector.
Kubernetes-commit: 0b2b6489de8f75d5299f54180617601126bb8878
2022-07-25 08:02:54 +00:00
Lukasz Szaszkiewicz
441e2c8c97 reflector: simplify reading the resourceVersion
Kubernetes-commit: 63b125d4061d267ad8998ea30e054bb1445b1a5a
2022-07-15 10:14:26 +02:00
Lukasz Szaszkiewicz
4e28921c86 reflector: refactor watchHandler
Kubernetes-commit: e9e26068b746315b616a26b91ff2613f98e934bc
2022-06-24 13:44:32 +02:00
Ismayil Mirzali
664b1a6c8c client-go: refactor: Fix styling issues (#107248)
* client-go: Remove unreachable return

Due to the way the switch statement is done,
the return at the end of the function will neverbe reached.

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

* client-go: Refactor for clarity

Fixed one instance where the error message should be lowercase.
Made the fields in the struct literal more explicit

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>

Kubernetes-commit: 75c0987de3cb9a0380873745f68dea2f0835a7a2
2022-01-18 12:03:08 +02:00
wojtekt
01243dd50e Migrate to k8s.io/utils/clock in client-go
Kubernetes-commit: bb7dac443a2039f97c822f610e78d4b65482c56d
2021-09-17 11:36:09 +02:00
wojtekt
03ebb2739b Handle 429 errors from watch requests in reflector library.
Kubernetes-commit: a9daa46d470e87ed328688bebd9314cc5ac0fc4a
2021-03-13 12:29:44 +01:00
wojtekt
866e6a7e3c Allow tracking resource version for reflector store
Kubernetes-commit: 4af1328bb8a3b3eb2289bbbe624480548dd39cdc
2020-08-31 15:58:16 +02:00
Kevin Delgado
4d01b584c3 Add exp backoff for connection refused errors
Currently when ListAndWatch() receives a connection refused error, it is
assumed to be due to the apiserver being transiently unresponsive. In
situations where a controller is running outside the k8s cluster it's
controlling, it is more common for the controller to lose connection
permanently to the apiserver and needs to exponentially backoff its
retry rather than continously spamming logs with Watch attempts that
will never succeed.

Kubernetes-commit: 1ff789f2bb9bf7fbb3df35977bc249c0dd019d31
2020-08-25 19:15:21 +00:00
janeczku
47f16e33aa Fixed reflector not recovering from "Too large resource version" errors with API servers 1.17.0-1.18.5
Kubernetes-commit: e1f4bfe1db8d3975bf626c2c8536dd8076aeb7d4
2020-08-28 21:17:27 +02:00
wojtekt
ec46b97af4 Fix bug in reflector not recovering from "Too large resource version" errors
Kubernetes-commit: 3704174f95c7311e025284ef30bb56945fa6e7cc
2020-06-26 09:45:29 +02:00
Jordan Liggitt
33c1f9f2a4 Fix client watch reestablishment handling of client-side timeouts
Kubernetes-commit: 343c1e7636fe5c75cdd378c0b170b26935806de5
2020-03-30 10:36:01 -04:00
wojtekt
0e2dbbf70a Switch pager to return whether the result was paginated
Kubernetes-commit: 5dcf08c1993718e94cf6537af50e0a411dd2878c
2020-01-28 09:39:27 +01:00
wojtekt
5534e24283 Avoid thundering herd on etcd on masters upgrade
Kubernetes-commit: 773d3583bcb7a2ac39c772a9861978d81db0df2f
2019-12-30 13:53:28 +01:00
danielqsj
f67770132d unify alias of api errors under pkg and staging
Kubernetes-commit: 5bc0e26c1902e7e28abfc828de19a2dbb3e492c2
2019-11-12 16:26:59 +08:00
Mateusz Matejczyk
d7b4c23325 pager.go: Don't set ResourveVersion on subsequent List calls
Ref. https://github.com/kubernetes/kubernetes/issues/85221#issuecomment-553748143

Kubernetes-commit: 977ca43d640d2a85e199a8a282e2df8ebd88055a
2019-11-14 11:34:59 +01:00
Joe Betz
54033229aa Handle expired errors with RV>0 in pager, don't full list if 1st page is expired
Kubernetes-commit: 1f3dc14eea231c90819cbba06f25cb4221236b3f
2019-10-04 17:08:22 -07:00
Maru Newby
ab4e4fccf4 Add support for type checking Unstructured via GVK in reflector
It was previously possible to instantiate `Reflector` with
`*unstructured.Unstructured` as the expected type but this did not
support checking that event objects were of the correct API
type (e.g. if event object was `v1.Pod` in `Unstructured` form but
`v1.Service` was expected). This commit adds support for providing a
GVK via an `Unstructured` expected type to compare with the GVK of
event objects. The GVK will also be used in reflector log output.

Kubernetes-commit: 237dbfd8ad322dfcad4bd4d5345368480c22d82f
2019-09-24 01:20:40 +00:00
likakuli
6a1fb71239 fixes a bug that connection refused error cannot be recognized correctly
Kubernetes-commit: 3cec9098020ecc168573c7ee658282954dac2a2e
2019-08-20 12:18:46 +08:00
Joe Betz
d858f18787 Paginate List call performed by Reflector's ListAndWatch call
Kubernetes-commit: 84723c2d3ef5ff5d30aadd1ad72068bf2254358c
2019-03-14 13:26:19 -07:00
Mikhail Mazurskiy
5f6ea627a3 Shared Informer Run blocks until all goroutines finish
Fixes #45454

Kubernetes-commit: d789615902ead2a112ad24fbfebe95285b87004b
2017-07-19 03:39:07 +00:00
Chao Xu
d82cfb70dd run hack/update-staging-client-go, somehow we copied listers/<authn,authz,imagepolicy>
Kubernetes-commit: ffe74d1fe749b5887711f70af24e1375856f2520
2017-06-28 00:06:44 +00:00
Chao Xu
1e9caa8e14 run root-rewrite-import-client-go-api-types
Kubernetes-commit: f2d3220a11111f86b2f481e70e3c1ca4f5896f44
2017-06-28 00:06:44 +00:00
Kubernetes Publisher
687fd42903 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 68f123dfa036bef57495f014a78144a9a1b517ca
2017-01-24 15:19:42 +00:00
Kubernetes Publisher
8fa0506b26 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is d9467519245c3858ac58c5fa91ec9e5b16c1f507
2017-01-18 15:19:42 +00:00
Kubernetes Publisher
204f12b1f3 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 616038db1b0d1e852b4a3d10c8c512a052f91fba
2017-01-14 15:19:47 +00:00
Kubernetes Publisher
124670e99d published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 81d788dd6e0748e5d53a62c16d933c5f7a0718af
2016-12-04 11:39:55 +00:00
Kubernetes Publisher
5d8c36c93c published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 124fb610dcbd445fa710da67508ac6d5b822f61d
2016-11-24 08:15:51 +00:00
Kubernetes Publisher
75399f68c8 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is e56cfc5322138aa23e6418ee30a6ab54c7c6fe8c
2016-10-21 04:44:19 +00:00
Chao Xu
a6d206121d remove the top-level folders for versions
remove scripts
2016-10-19 14:34:19 -07:00