Commit 433ed1a
authored
Watch a Kubernetes service from the latest resource version. (line#6305)
Motivation:
I found out that the Fabric8 Kubernetes client uses a list API to
establish a watch connection, such as
"/api/v1/namespaces/<namespace>/services?fieldSelector=metadata.name=<service-name>&watch=true".
Therefore, the resource version of a service cannot be used to indicate
the last known version.
Modifications:
- Do not specify a resource version to watch a service.
- The latest version is fetched instead.
- `watcher.eventReceived()` compares the cached version with the latest
version to decide whether an update is needed.
Result:
You no longer see `WatcherException: too old resource version` when
using `KubernetesEndpointGroup`.1 parent a041a7b commit 433ed1a
1 file changed
Lines changed: 8 additions & 3 deletions
File tree
- kubernetes/src/main/java/com/linecorp/armeria/client/kubernetes/endpoints
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
425 | 431 | | |
426 | | - | |
| 432 | + | |
427 | 433 | | |
428 | | - | |
429 | | - | |
| 434 | + | |
430 | 435 | | |
431 | 436 | | |
432 | 437 | | |
| |||
0 commit comments