Skip to content

Watch a Kubernetes service from the latest resource version. - #6305

Merged
ikhoon merged 1 commit into
line:mainfrom
ikhoon:k8s-endpointgroup-resource-version-bug
Jul 7, 2025
Merged

Watch a Kubernetes service from the latest resource version.#6305
ikhoon merged 1 commit into
line:mainfrom
ikhoon:k8s-endpointgroup-resource-version-bug

Conversation

@ikhoon

@ikhoon ikhoon commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

Motivation:

I found out that the Fabric8 Kubernetes client uses a list API to establish a watch connection, such as "/api/v1/namespaces//services?fieldSelector=metadata.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.

Motivation:

I found out that 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 inidicate
the last known version.

Modifications:

- Do not specify a resource vesrion 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`.
@ikhoon ikhoon added this to the 1.33.0 milestone Jul 2, 2025
@ikhoon ikhoon added the defect label Jul 2, 2025

@minwoox minwoox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

@ikhoon
ikhoon merged commit 433ed1a into line:main Jul 7, 2025
13 of 14 checks passed
@ikhoon
ikhoon deleted the k8s-endpointgroup-resource-version-bug branch July 7, 2025 02:49
@codecov

codecov Bot commented Jul 7, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (8150425) to head (a7436e4).
Report is 111 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #6305       +/-   ##
============================================
- Coverage     74.46%       0   -74.47%     
============================================
  Files          1963       0     -1963     
  Lines         82437       0    -82437     
  Branches      10764       0    -10764     
============================================
- Hits          61385       0    -61385     
+ Misses        15918       0    -15918     
+ Partials       5134       0     -5134     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants