Commit Graph

17 Commits

Author SHA1 Message Date
Patrick Ohly
57bc261e52 client-go watch: NewIndexerInformerWatcherWithContext -> WithLogger
The ability to automatically stop on context cancellation was new functionality
that adds complexity and wasn't really used in Kubernetes. If someone wants
this, they can add it outside of the function.

A *WithLogger variant avoids the complexity and is consistent with
NewStreamWatcherWithLogger over in apimachinery.

Kubernetes-commit: 1a8d8c9b4a33daf9330434e1ad544ef3571722a3
2025-01-31 10:18:04 +01:00
Patrick Ohly
bad1caabde client-go + apimachinery watch: context support
The Lister and Watcher interfaces only supported methods without context, but
were typically implemented with client-go API calls which need a context. New
interfaces get added using the same approach as in
https://github.com/kubernetes/kubernetes/pull/129109.

Kubernetes-commit: 6688adae142e37114d9dfa8d94cd1d8a91fbcc13
2024-12-20 13:55:47 +01:00
Arda Güçlü
21fffc1153 Embed context deadline exceeded in error to let errors.Is can work
Currently, watch package embeds context deadlineexceeded error
in it's own error using `%v`, as can be seen in here;

`fmt.Errorf("UntilWithSync: unable to sync caches: %v", ctx.Err())`

However, consumers of this function can not use
`errors.Is(err, context.DeadlineExceeded)` due this `%v`.

To let consumers can distinguish context deadlineexceeded errors,
this PR changes error embedding format to `%w`.

Kubernetes-commit: 6b7c365f8f6d50280c2dab171efdd4b93d964f32
2022-12-19 15:26:08 +03:00
Jordan Liggitt
422fe1f61e Fix indentation/spacing in comments to render correctly in godoc
Kubernetes-commit: 78cb3862f11225135afdf76f3424e2d7b33104c7
2022-12-17 17:31:05 -05:00
Davanum Srinivas
2a6c116e40 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
Dean Coakley
53da6da2bc Remove outdated comment on wait.Until
Kubernetes-commit: 53fef4a04598c3b1ee04c4930a29dbad5bb9ca63
2020-08-20 02:08:17 +01: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
wojtekt
16393a6dc7 Remove ListWatchUntil
Kubernetes-commit: ead12b02fed9e8c3a8ebf693f71fa452115d923b
2020-05-07 20:21:46 +02:00
Tomas Nozicka
8ecda4e5ed Upgrade ListWatchUntil
Kubernetes-commit: 603dd254ac91b3581f9b431ff91a95d929a97e04
2019-02-18 18:20:23 +01:00
Tomas Nozicka
ce00ab47ae Add Until based on RetryWatcher
Kubernetes-commit: 09af8485f253421cdf0c20a40d12784e8fcffd5a
2019-01-03 13:45:46 +01:00
Tomas Nozicka
36160aac1b Make UntilWithSync wait for integrated informers to stop
Kubernetes-commit: b762d2c0d7977a93ee9aab4cefb9363bc0c79ea5
2019-01-21 18:30:00 +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
Tomas Nozicka
4528feba43 Add UntilWithSync (informer based)
Kubernetes-commit: 866cc1acab6c1c30a7550b2de7160c8052be884d
2018-08-03 16:45:41 +02:00
Tomas Nozicka
6dac86f710 Deprecate ListWatchUntil, fix it and call places
Kubernetes-commit: e434f3189e81e473aa89e3589ca81545d1341cf8
2018-08-03 16:08:28 +02:00
Tomas Nozicka
82acb64076 Move ListWatchUntil to its kin
Kubernetes-commit: 07b8373ab393547239ed4fe227758a1715480f22
2018-08-03 15:22:42 +02:00
Tomas Nozicka
cbdb98d74d Rename Until to UntilWithoutRetry and move to using context so it's
cancelable

Kubernetes-commit: 3d4a02abb54244861f9f05b8db2fdfdaa2c6f67c
2018-08-02 14:11:59 +02:00
Tomas Nozicka
5764fa1b79 Move Until from apimachinery to client-go
Kubernetes-commit: ccb92f6ef867c9e2ede91b7877a492a161986623
2018-08-01 19:35:46 +02:00