Commit Graph

17 Commits

Author SHA1 Message Date
Patrick Ohly
5d289bc44c client-go/tools/cache: add APIs with context parameter
The context is used for cancellation and to support contextual logging.

In most cases, alternative *WithContext APIs get added, except for
NewIntegerResourceVersionMutationCache where code searches indicate that the
API is not used downstream.

An API break around SharedInformer couldn't be avoided because the
alternative (keeping the interface unchanged and adding a second one with
the new method) would have been worse. controller-runtime needs to be updated
because it implements that interface in a test package. Downstream consumers of
controller-runtime will work unless they use those test package.

Converting Kubernetes to use the other new alternatives will follow. In the
meantime, usage of the new alternatives cannot be enforced via logcheck
yet (see https://github.com/kubernetes/kubernetes/issues/126379 for the
process).

Passing context through and checking it for cancellation is tricky for event
handlers. A better approach is to map the context cancellation to the normal
removal of an event handler via a helper goroutine. Thanks to the new
HandleErrorWithLogr and HandleCrashWithLogr, remembering the logger is
sufficient for handling problems at runtime.

Kubernetes-commit: 4638ba971661497b147906b8977ae206c9dd6e44
2024-07-26 15:26:00 +02:00
Stephen Kitt
841e997e33 Improve the lister function documentation
In particular, document that ListAllByNamespace delegates to ListAll
if no namespace is specified.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 54e899317ef46e3b70827cacee244717022db0ad
2024-04-19 17:58:02 +02:00
astraw99
f549acf3ce Fix duplicate code block of ListAll function
Kubernetes-commit: d8db1e9ba3c110012def6faa5579ad3abb71a6a6
2022-03-24 14:47:20 +08:00
Davanum Srinivas
75fea27a27 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
RainbowMango
2b8d87c082 1. Fix lint errors for the whole directory staging/src/k8s.io/client-go/tools/cache;
2. Remove staging/src/k8s.io/client-go/tools/cache from .golint_failures;
3. Fix some typo from comments.

Kubernetes-commit: 0e0e1f7daba0a6ae6dd59df0a1bb643c323ad8cb
2019-07-10 12:00:52 +08:00
wojtekt
a2b80e67e1 Speedup listers for empty selectors
Kubernetes-commit: 91e7f466b916c50b8c1cdb330fd06b397f49a358
2018-12-28 15:34:43 +01:00
Davanum Srinivas
74cd8bbeee Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05: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
6841809cf1 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 9a89e8cdcb0fd8a887822bc3c573cdb2259424c5
2016-12-08 12:17:59 +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
ae6775eeec published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 1bc5b822cd566321c115d4ebac5d97cfd347d687
2016-11-11 03:39:04 +00:00
Kubernetes Publisher
b22087a53b published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 71ba8a90f0a4f3a307cffeb8f8566d13277cb135
2016-10-30 21:06:23 +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